Tutorialsplane

Vue.js string indexOf


String indexOf Method– We can use native JavaScript indexOf to get the position of first occurrence of specified value. Here in this tutorial, we are going to explain how you can use this method to find the position of string/character in vuejs.


String indexOf Method In Vue.JS Example

You can get the position of a specified value in a string simply as below-

Example:




 


<div id="app">
	{{result}}
</div>
        


Try it »

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