How to get substring from a string using jQuery
substring() method. The
substring() method return substring based on the start (required) and end-position (optional) arguments. If end position is not specified it extracts the rest of the string.
Let's take a look at the following example to understand how this method basically works:
ExampleTry this code »
var myStr = "The quick brown fox jumps over the lazy dog";
var subStr = myStr.substring(4, 20);
Here are some more FAQ related to this topic: