A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/javascript/String/split below:

split ยท WebPlatform Docs

split Summary

Split a string into substrings using the specified separator and return the substrings as an array.

Syntax
stringObj.split([separator[, limit ]])
stringObj
Required. The String object or string literal to be split. This object is not modified by the split method.
separator
Optional. A string or a Regular Expression object that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
limit
Optional. A value used to limit the number of elements returned in the array.
Return Value

The result of the split method is an array of strings split at each point where separator occurs in stringObj. The separator is not returned as part of any array element.

Examples

The following example illustrates the use of the split method.

var s = "The quick brown fox jumps over the lazy dog.";
 var ss = s.split(" ");
 for (i in ss) {
     document.write(ss[i];
     document.write("<br/>");
 }

 
 
 
 
 
 
 
 
 
 
See also Other articles Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4