Skip to content
Reference > Methods

strSplitLines(text)

Definition

List strSplitLines(String text)

Description

Splits a string with multiple lines into a list and returns that list. Handles newlines and carriage returns.

Parameter Definition

Name Type Description
text String The string to split

Examples

1
2
3
4
List r1 = strSplitLines("test\nme\nout"); // r1 == [test, me, out]
List r2 = strSplitLines("test"); // r2 == [test]
List r3 = strSplitLines(null); // r3 == []
List r4 = strSplitLines("\n\n"); // r4 == [, ]