How to Get a Substring from a string in JavaScript ?

Below is a sample code snippet demonstrating how to get a substring or extract a string from a string in JavaScript.

How to Get a Substring from a string in JavaScript ?

<string>
  var input = "Ginktage Blog";
  var output = input.substring(0, 7);
</string>

The output of the above substring method call will be Ginktage.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

No, the forward navigation is currently not supported in Windows Phone 8. Q&A #42 – Is Forward Navigation supported in...
A few months back i had posted a Q&A on the Topic " What it takes to be a Good...
If you are a regular readers of the technical books , Apress is one of the publishers which comes in...