String.split
String.split
Function
Split a string by delimiter.
Syntax
string.split(separator)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| separator | Any | No | '' | separator, it will be converted into a string first when called. |
Return value
| Type | Description |
|---|---|
| Array | Returns the split string array. |
Example
text = 'a,b,c' result = text.split(',') // Output: ["a","b","c"] print result
Notes
- Split by characters when the delimiter is an empty string.