Tutorialsplane

AngularJs Check String StartsWith


AngularJs Check String StartsWith: We can use JavaScript startsWith() method to check whether a string starts with certain characters. Here in this tutorial we are going to explain how you can use JavaScript startsWith() function to check whether the string starts with certain characters in AngularJs.


AngularJs Check String StartsWith Example

JavaScript startsWith() method checks whether a string starts with certain characters. This method returns true if the character match is found at the starting of the string else it will return false. Let us create an example to understand how we can use JavaScript startswith method in AngularJs.

AngularJs Check String StartsWith Example:




 
 

  
<div ng-app="myApp">  
<div ng-controller="myController"> 
<button type="button" ng-click="startswithExample()">Click Me</button>
<p>Result = {{result}}</p>
</div> 
</div>
  
  

Try it »

If you run the above example it will produce output something like this –