Answers for "split a string by line in javascript"

2

split text by new line javascript

myText.split(/\n/)
Posted by: Guest on January-24-2021
4

javascript split

var names = 'Harry ;Fred Barney; Helen Rigby ; Bill Abel ;Chris Hand ';

console.log(names);

var re = /\s*(?:;|$)\s*/;
var nameList = names.split(re);

console.log(nameList);
Posted by: Guest on April-25-2020

Code answers related to "split a string by line in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language