Split
type | returns |
Method | array<string> |
name | type | description | |
seperator | string | regex, default: /\s+/ | The seperator the split upon |
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"]
Last modified 3yr ago