str.split()
1st October 2023
0 Comments
Programming Language
JavaScript [Version: ECMAScript (ECMA-262)]
Syntax
Typical Usage
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.
Accepted Parameters
- 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.
Notes
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.
Used In Projects
Source
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
Was This Helpful?
If this post has helped you, please let me know. Your feedback will be highly appreciated and will help me build better content.