Answers for "split string separated by space into array javascript"

2

javascript split string into array by comma and space

input.split(/[ ,]+/); //splits string using RegEx on a space OR a comma
Posted by: Guest on June-11-2020
0

javascript explode space

var str   = "my car is red";
var stringArray = str.split(/(\s+)/);

console.log(stringArray); // ["my", " ", "car", " ", "is", " ", "red"]
Posted by: Guest on March-27-2020

Code answers related to "split string separated by space into array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language