Answers for "how to replace commas with nothing in javascript"

0

replace all commas in string javascript

string.replace(/,/g, '-');
Posted by: Guest on July-12-2021
0

how to replace commas with nothing in javascript

var myStr = 'this,is,a,test';
var newStr = myStr.replace(/,/g, '');

console.log( newStr );  // "this-is-a-test"
Posted by: Guest on January-27-2021

Code answers related to "how to replace commas with nothing in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language