Answers for "remove commas in a string javascript"

4

remove commas from string javascript

var stringWithCommas = 'a,b,c,d';
var stringWithoutCommas = stringWithCommas.replace(/,/g, '');
console.log(stringWithoutCommas);
Posted by: Guest on May-17-2020
0

javascript remove multiple commas from string

/[,\s]+|[,\s]+/g

var str= "your string here";
//this will be new string after replace
str = str.replace(/[,\s]+|[,\s]+/g, 'your string here');
Posted by: Guest on May-19-2021

Code answers related to "remove commas in a string javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language