Answers for "js split string on whitespace"

3

js split text on spaces

var string = "text to split";
var words = string.split(" ");
Posted by: Guest on March-23-2020
0

split by whitespace javascript

var text = "hoi how     are          you";
var arr = text.split(/\s+/);
Posted by: Guest on May-24-2021
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

Code answers related to "js split string on whitespace"

Code answers related to "Javascript"

Browse Popular Code Answers by Language