substring() string method extracts a range of characters from a string. The
substring() method is passed two values: the first number is the idex where to start the extraction and the second number is the idex where to stop the extraction, not including itself. Keep in mind that the first character in the string is at index
0. If the second index number is missing, then the
substring() method returns the rest of the string past the first index.
Here is an example:
var example_string = "My name is Dusty"; var first_name = example_string.substring(11,16); document.write(first_name);
In this example
Dusty is written to the screen.