This function splits the string by a delimiter and returns an array of parts.
Parameter | Description |
---|---|
delimiter | the separator used to split the string |
Returns an array of string parts.
If the delimiter is not found in the string, the entire string will be returned. If the delimiter is an empty string, all whitespace characters will be used to split the string.
local s = "dog,cat,raccoon,fox,crow,snake,rabbit,deer"
local sarr = Split(s, ",")
for _, s in ipairs(sarr) do
Print(s)
end