I have a string with multiple commas, and the string replace method will only change the first one:
var mystring = "this,is,a,test"
mystring.replace(",","newchar", -1)
Result: "thisnewcharis,a,test"
The documentation indicates that the default replaces all, and that “-1” also indicates to replace all, but it is unsuccessful. Any thoughts?