Optional
str: stringThe string to split.
Optional
separator: string | RegExpThe separator pattern to split by.
Optional
limit: numberThe length to truncate results to.
Returns the string segments.
5.0.0
split('a-b-c', '-', 2)
// => ['a', 'b']
Splits
string
byseparator
.Note: This method is based on
String#split
.