I have tried var res = str.replace(/ |,|.|/g, ""); and var res = str.replace(/ |,|.|/gi, "");. What am I missing here?
var str = "Text with comma, space and period."; var res = str.replace(/ |,|.|/g, ""); document.write(res); I have tried var res = str.replace(/ |,|.|/g, ""); and var res = str.replace(/ |,|.|/gi, "");. What am I missing here?
var str = "Text with comma, space and period."; var res = str.replace(/ |,|.|/g, ""); document.write(res);