screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> </head> <body> <div id="app"> <h3>Vue Get string after specific character</h3> <p>Original string: {{ myString }}</p> <p>Substring after Pipline: {{ getSubstring(myString) }}</p> </div> <script type="module"> const app = Vue.createApp({ data() { return { myString: 'This is question | This is Answer' }; }, methods: { getSubstring(str) { return str.split('|')[1]; // Returns the second element after splitting by '|' } } });app.mount("#app"); </script> </body> </html>