screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <body> <div id="app"> <h2>Vue js string.lastIndexOf(substringr) Method </h2> <p>Finding the position of the last-occurring character in a given text </p> <p>{{text}}</p> <p>Search String:{{searchString}}</p> <button @click="myFunction">Get Position</button> <p>Last Index :: {{results}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ text : 'Hello David! David, you look so strong and healthy .', searchString:'David', results:'' } }, methods:{ myFunction(){ this.results = this.text.indexOf(this.searchString); }, } }).mount('#app') </script> </body> </head> </html>