AngularJs Substring: JavaScript substring Method is used to extract characters of string between two specified positions ie start and end. Here in this tutorial we are going to explain how you can use JavaScript substring() method to extract character from string. You can also use our online editor to edit and run the code online.
AngularJs Substring JavaScript Example
Let us create an example to understand how to use JavaScript substring function to extract the characters in AngularJs-
AngularJs Substring Method Example:
<div ng-app="myApp"> <div ng-controller="myController"> <button type="button" ng-click="substringExample()">Click Me</button> <p>Result = {{result}}</p> </div> </div> |
In the above example we have created an example which will extract characters from the string.
If you run the above example it will produce output something like this –