Here you can find the source of getLine(String text, int line)
public static String getLine(String text, int line)
//package com.java2s; public class Main { public static String getLine(String text, int line) { int tempPos, tempStart, tempEnd; for (int pos = 0; pos <= text.length();) { //Get the Start Offset tempStart = pos;//from w w w. j a va 2 s . co m //Get the End Offset tempPos = text.indexOf("\n", pos); if (tempPos == -1) { //No more lines //End Offset is the end of the string tempEnd = text.length(); pos = tempEnd + 1; } else { //There is one more line tempEnd = tempPos; pos = tempEnd + 1; } //TODO: Add Android logging /* TestInfo.testWriteLn("-----------------"); TestInfo.testWrite("Row: " + row); TestInfo.testWrite(" - Start: " + tempStart); TestInfo.testWriteLn(" - End: " + tempEnd); */ //Write line if (tempStart == tempEnd) { } else { } //TODO: TestInfo.testWriteLn(strLine); } return ""; } }