in string and then breaks the string before and after each occurr ence of delimiter .
Thus-obtained substrings (withou t any delimiting text) are then arrang ed into an array,
which spl it() returns. Note that, if the delimiter occurs at the beginning of string ,
the first element in the returned array will be an empty string. The same goes for the
situation whe n the delimiter occurs at the end of string : the last element in the
returned array will be an empty string.
The delimiter argument can also be an empty string, in which case string is
broken between each c haracter so that the returned array has the sam e length as the
original string.
If delimiter is omitted, the returned array contains a single element that is eq ual to
string .
Examples:
var commaDelimited = "6, 33, 1, 7,";
commaDelimited.split(",") //Returns ["6", " 33", " 1", " 7", ""]
var s = "HELP!";
s.split("") //Returns ["H", "E", "L", "P", "!"]
toLowerCase()
Syntax:
string .toLowerCase()
Returns a copy of string with all upper-case letters (if any) replaced by their lower-
case counterparts. The method does not modify string itself.
toString()
Syntax:
string .toString()
Returns the primitive string value stored in string . This m ethod is usually invoked
internally by JavaScript and you will almost never need to call it explicitly.
toUpperase()
Syntax:
string .toUpperCase()
Returns a copy of string with all lower-case letters (if any) replaced by their upper-
case counterparts. The method does not modify string itself.
426 JavaScript Reference