var myStr = "hii, hello, welcome"; myStr = myStr.replace(/,/g, ""); console.log(myStr) // OUTPUT hii hello welcome