string.split
This function slices a string into all substrings separated by <sep> and returns a slice of the substrings between those separators.
Syntax
string.split(str, separator)
Arguments
Argument |
Type |
Description |
---|---|---|
str |
string |
Source string |
separator |
string |
Separator |
Returns
Type |
Description |
---|---|
array |
Slice of substrings between the specified separator |
Examples
The function string.split("Hello,World", ",")
returns [Hello,World]
.