There shouldn't be a need to read the file twice.
Append a new line
while ( //reading ){
text.append(in.readLine());
text.append("\n");
}
Type: Posts; User: copeg
There shouldn't be a need to read the file twice.
Append a new line
while ( //reading ){
text.append(in.readLine());
text.append("\n");
}
You may have to post more code...where does the variable num come from? If you've read the file already then readLine returns null (and this nulls are appended to the StringBuffer)
Use a StringBuilder or StringBuffer, appending the lines as you loop through the array (or read the file). Then just convert to a string
StringBuffer sb = new StringBuffer();
String[] lines =...