Tutorialsplane

Vue.js String Split


JavaScript split function basically converts a string into array of substring. We can use the native JavaScript split function to convert a string into array of substring. Here in this article we are going to explain how you can use this method in Vuejs. You can also use online editor to edit and run the code online.


Vue.js String Split Method Example

Here is an example to use split function in vue.js-

Example:




 


<div id="app">
	<div id="myId" ref="myId">{{ splitedStr }}</div>
	<button>Click Me</button>
</div>
        


Try it »

The above example will split the string at blank space (” “), you can also define other parameters as well such as split string at (-).

Output of above example-