Substitua todas as vírgulas em javascript de string
string.replace(/,/g, '-');
Successful Sandpiper
string.replace(/,/g, '-');
var myStr = 'this,is,a,test';
var newStr = myStr.replace(/,/g, '');
console.log( newStr ); // "this-is-a-test"