split
Modified on Wed, 02 Aug 2023
Description
Split string by separator
Syntax
split(text, seperator, limit)
Parameters
| Input Parameter | Type | Description |
|---|---|---|
| text | string | The string to split. |
| seperator | string | The separator pattern to split by. |
| limit (optional) | number | The length to truncate results to. |
Return value
| Type |
|---|
| Array |
Sample
| Example | Result | Description |
|---|---|---|
| split('John,Paul,Jr', ',') | ['John', 'Paul' , 'Jr'] | split by ',' |
| split('John--Paul--Jr', '--') | ['John', 'Paul' , 'Jr'] | split by '--' |
| split('John,Paul,Jr', ',', 2) | ['John', 'Paul'] | split for 2 results |
To view all the String functions, click here.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article