[det]string_lines(?String, 
?Lines)\n"). E.g.
?- string_lines("a\nb\n", L).
L = ["a", "b"].
?- string_lines(S, ["a", "b"]).
S = "a\nb\n".
This predicate is a true relation if both arguments are in canonical form, i.e. all text is represented as strings and the first argument ends with a newline. The implementation tolerates non-canonical input: other types than strings are accepted and String does not need to end with a newline.
- See also
 - split_string/4. 
Using 
split_string(String, "\n", "", Lines)on a string that ends in a newline adds an additional empty string compared to string_lines/2.