JavaScript String split()
JavaScript String split()
The split() method is used to split a string into an array of substrings. It will return a new array without having any effect on the original string. If the separator is (" "), then the string is split between words.
Syntax:-
Its syntax is:- string.split(separator, limit)
Return:-
Its return is:- array containing the split values
Further Explanation:-
Parameter | Description |
separator | Optional. A string or regular expression to use for splitting. |
limit | Optional. An integer that limits the number of splits. |