splitLines property

Iterable<String> get splitLines

Splits the String into a List of lines ('\r\n' or '\n').

If the String is null, an ArgumentError is thrown.

Example

String text = 'hello\nworld';
List<String> lines = text.splitLines();
print(lines); // prints ['hello', 'world']

Implementation

Iterable<String> get splitLines => splitAny(breaklineChars);