Java Public Recipes
The above code reads the next line of text from the scanner and stores it in line variable.
import java.util.Scanner;
Scanner scanner = new Scanner(myString);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
}
scanner.close();