Vue JS Convert String to Array | Vue JS Split String Example

By Hardik Savani | June 28, 2019 | Category : Vue.JS

Today i will show you how to convert string to array using split() in vue js. i will give simple example of split string with space, comma, semicolon etc in vuejs.

If you worked with javascript then you know split() and how it use. The split() method is used to split the string into an array of the substring and returns a new collection array. you can see bellow following syntax:


bellow i gave you simple example of convert string into an array with space. i will also show you output of array, so you can understand how it works.


<!DOCTYPE html>



<title>Vue JS Convert String to Array | Vue JS Split String Example -</title>

<script src=""></script>



<div id="app">

<p>String : {{ myString }}</p>

<p>Array : {{myResult}}</p>

<button @click="clickFunction()">Click Me</button>


<script type="text/javascript">

var app = new Vue({

el: '#app',

data: {

myString: "This is" ,

myResult: ''



clickFunction: function () {

this.myResult = this.myString.split(" ");








String : This is

Array : [ "This", "is", "" ]

I hope it can help you...

Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.

We are Recommending you: