Method 1:
BufferedReader reader = new BufferedReader(new StringReader(
reader.readLine();
Method 2:
final String eol = System.getProperty("line.separator");
output = output.substring(output.indexOf(eol + 1));
Method 3:
String[] lines = string.split(System.getProperty("line.separator"));
Method 4:
Scanner scanner = new Scanner(myString);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
// process the line
}
No comments:
Post a Comment