String.split

Splits a String object into an array of strings by separating the string into substrings.

Method of String

Syntax

split( [separator][, limit] )

Parameters

Parameter Description
separator Specifies the character to use for separating the string. The separator is treated as a string. If separator is omitted, the array returned contains one element consisting of the entire string.
limit Integer specifying a limit on the number of splits to be found.

Description

The split method returns the new array.
When found, separator is removed from the string and the substrings are returned in an array. If separator is omitted, the array contains one element consisting of the entire string.

See also

String.charAt, String.indexOf, String.lastIndexOf

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.