split() uses a pattern or separator to divide a string into a list of substrings by searching for the pattern or separator. It puts the substrings into an array, and returns the array.
- separator: (The pattern or character to be used to split the string).
- limit: A non-negative integer specifying a limit on the number of substrings to be included in the array.
If the separator is an empty string (“”), the string is converted to an array of each of its UTF-16 “characters”, without empty strings on either ends of the resulting string.