String.substring(start-index,stop-index)
- start-index: (Required - Numeric Value) - where to start the extraction
- stop-index : (Optional - Numeric Value) - where to stop the extraction
var str = "Hello World"; document.write(str.substring(4,8));
String.substr(start-index,length)
- start-index: (Required - Numeric Value) - where to start the extraction
- length : (Optional - Numeric Value) - how many characters to extract
var str = "Hello World"; document.write(str.substr(4,4));
Since JavaScript substr() is not cross-browser, I never use it.
–end–