Name

split() — NN 4 IE J3 ECMA 1

Synopsis

split(delimiter 
                     [, limitInteger])

Returns a new array object whose elements are segments of the current string. The current string is divided into array entries at each instance of the delimiter string specified as the first parameter of the method. The delimiter does not become part of the array. You do not have to declare the array prior to stuffing the results of the split() method. For example, if a string consists of a comma-delimited list of names, you can convert the list into an array as follows:

var listArray = stringList.split(",")

You may also use a regular expression as the parameter to divide the string by a pattern rather than a fixed character.

Returned Value

Array.

Parameters

delimiter

A string or regular expression that defines where the main string is divided into elements of the resulting array.

limitInteger

An optional integer that restricts the number of items converted into array elements. This parameter is recognized only by Navigator 4.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.