15 1 0 4000 1 https://codeblock.co.za 300 true 0
theme-sticky-logo-alt

str.split()

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.

Was This Helpful?

Previous Post
str.trim()
Next Post
arr.shift()

0 Comments

Leave a Reply