If separator is a regular expression, any included parenthesis cause submatches to be included in the returned array. Using the optional limit argument, you can avoid including trailing empty elements in the returned array. Examples Example 1. In the following example, split looks for zero to many spaces followed by a semi-colon followed by zero to many spaces and, when found, removes them from the string. Returns the characters in a string beginning at the specified location through the specified number of characters.
Parameters string is any string.
Method of String object Description start is a character index. The index of the first character is zero, and the index of the last character is stringName .length -1. If length is 0 or negative, no string is extracted. If length is omitted, start extracts characters to the end of the string. Parameters string is any string.