Skip to content
Reference > Methods

splitLines(text)

Definition

List splitLines(String text)

Description

Returns a list of splitted lines using line feed and line return chars.

Parameter Definition

Name Type Description
text String The string to split

Examples

1
2
3
4
List r1 = splitLines("these are\ntwo lines"); // r1 == [these are, two lines]
List r2 = splitLines("these are\r\ntwo lines"); // r2 == [these are, two lines]
List r3 = splitLines("this is one line"); // r3 == [this is one line]
List r4 = splitLines("this is one line\n"); // r4 == [this is one line]