var myStr = 'this,is,a,test';
var newStr = myStr.replace(/,/g, '-');
console.log( newStr ); // "this-is-a-test"
var str = "Original string!";
var str = str.replace("Original", "New");
function strReplace(){
var myStr = 'quick_brown_fox';
var newStr = myStr.replace(/_/g, "-");
// Insert modified string in paragraph
document.getElementById("myText").innerHTML = newStr;
}