Last updated 4 years ago
Returns the string split upon the given seperator as a string array. If the argument is a regex, the string will be split where the regex matches.
"hello world".split(" ") == ["hello", "world"] "hello world".split() == ["hello", "world"] "Hello, World".split(/[^A-Za-z]/) == ["Hello", "World"]
type
returns
Method
array<string>
name
description
seperator
string
regex, default: /\s+/
/\s+/
The seperator the split upon