Microsoft® JScript split Method |
Language Reference Version 3 |
Splits a String object into an array of strings by separating the string into substrings.
stringObj.split(str)
The split method syntax has these parts:
Part Description stringObj Required. The String object or literal to be split. This object is not modified by the split method. str Required. A string or Regular Expression object describing what character is used to define where the splits take place.
The result of the split method is an array of strings split at each point where str occurred in stingObj.The following example illustrates the use of the split method:
function SplitDemo() { var s, ss; var s = "The quick brown fox jumped over the lazy yellow dog."; // Split at each space character ss = s.split(" "); return(ss); }