JavaScript Substr String Function 02

In the previous sample we learnt the simple method to use the JavaScript Substr function that accepts only 1 parameter as start index and returns the sub string starting from the specified starting index to the end of the provided string. In this sample we will use the optional parameter of JavaScript substr function i.e. length that allows the function to return the sub string of specified length starting from the specified start index. Try the following sample to understand the functionality:

Edit this code and click update to view output
OUTPUT:
  • HIRE EzineASP.Net Developers