Answers for "replace commas 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
1

remove commas from string javascript

var purpose = "I, Just, want, a, quick, answer!";

// Removing the first occurrence of a comma
var result = purpose.replace(",", "");

// Removing all the commas
var result = purpose.replace(/,/g, "");
Posted by: Guest on October-23-2020
0

replace all commas in string javascript

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

Code answers related to "replace commas javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language