split
Splits a string around matches for a specific character or sequence of characters.
You can also use a pattern of characters known as a regular expression or regex.
Strings matching the expression are removed, and the output is a list of substrings.
Parameters
STRING (string)
The input string.
REGEX (string)
A character, sequence of characters, or regular expression.
LIMIT (number)
Optional. The number of substrings in the result.
Default: No limit
Examples
These examples were produced in a project with these settings:
Setting | Value |
---|---|
CONJUNCTION |
|
USE OXFORD COMMA |
|
SEPERATOR |
|
ENABLE AUTOMATIC SENTENCE CAPITALISATION |
|
You can split the string around one character.
ATL in Script | Printed Result |
---|---|
| a string to and e split |
The output list has two substrings: 'a string to' and 'e split'. The matching 'b' in the input string is removed.
Note
As per the project settings, the list is printed with a conjunction.
You can use a regular expression in the second parameter.
ATL in Script | Printed Result |
---|---|
| John jumps, skips and hops. |
The input to the second parameter — '. John'
— is a regular expression. The period in the expression matches any character, so the expression matches ', John'
and '. John'
in the input string.
Note
As per the project settings, the list is printed with separators and a conjunction.
The third parameter allows you to limit the number of substrings.
ATL in Script | Printed Result |
---|---|
| John jumps and skips. John hops. |