How to split string to array by comma using jquery?

By Hardik Savani | June 3, 2019 | Category : Javascript jQuery

Are you need to explode string to array by comma in jquery, then i will give you solution to explode string to array by comma, space etc. we will do it using jquery split(). we will split string into array by space or comma in jquery.

The split() function is used to split a string into array of substrings, and returns the new array.

I will give you simple example for this bellow example, i created simple string with comma. then i will use split function to create an array using split function in jquery. so let's see bellow simple example:


<!DOCTYPE html>



<title>How to split string to array by comma using jquery? -</title>



<script type="text/javascript">

var myString = "A,B,C,C,D,E,F,G,H";





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: