Optional
trim: booleanIf true, entries will be trimmed for whitespace after splitting.
Optional
limit: numberIf not given or < 0, the string will be split on every
occurrence of separator
. Otherwise, it will be split on
the first limit
number of occurrences of separator
.
Similar to String.prototype.split except that
limit
is interpreted as the maximum number of splits, and the returned array containslimit + 1
entries. Also iflimit
is given and the number of substrings is greater than the limit, all the remaining substrings are present in the final substring.Example