Split String into Words JavaScript-
The following example uses the split()
method to split the string into words:-
let str = 'JavaScript String split()';
let substrings = str.split(' ');
console.log(substrings);
Split String into Words JavaScript-
The following example uses the split()
method to split the string into words:-
let str = 'JavaScript String split()';
let substrings = str.split(' ');
console.log(substrings);