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
The easiest and most universal approach would be to just use the regex Linebreak matcher \R which matches Any Unicode linebreak sequence:
Pattern NEWLINE = Pattern.compile("\\R")
String lines[] = NEWLINE.split(input)
@see https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html