Given a string that isn't too long, what is the best way to read it line by line?
I know you can do:
BufferedReader reader = new BufferedReader(new StringReader(<string>));
final String eol = System.getProperty("line.separator");
output = output.substring(output.indexOf(eol + 1));
You can also use the
split method of String:
String lines = string.split(System.getProperty("line.separator"));
This gives you all lines in a handy array.
I don't know about the performance of split. It uses regular expressions.