JavaScript String method: substring()
[this page | pdf | back links]
The substring() method (when applied to a JavaScript
string) returns
a substring defined by the start position and number of characters.
It
has the following syntax with the following parameters:
string.substring(startposition, endposition)
|
Parameter
|
Required / Optional
|
Description
|
|
startposition
|
Required
|
Position from where to
start returned string. First character is at position 0.
|
|
endposition
|
Optional
|
(default is string.length). Position up to (but not
including) where characters are returned from. If omitted then returns rest
of string. If before startposition then the two are treated as if they
were reversed.
|
NAVIGATION LINKS
Contents | Prev | Next | JavaScript String Variables