Split a string into substrings using the specified separator and return them as an array.
split(separator, limit?)
separator optional
The string to use in separating the string. If omitted, a single-element array containing the entire string is returned. If empty string, the string is split into an array of single UTF-16 code units.
limit optional
The maximum number of elements returned in the array.
An array of strings.
"coffee/tea/milk".split("/")
["coffee", "tea", "milk"]
"coffee,tea,milk".split(",", 2)
["coffee", "tea"]
"Sum 41 band".split(/\d/)
["Sum ", "" ," band"]
`one
two three
four`.split(/\s+/)
["one", "two", "three", "four"]