I have a line where there may be special characters that I need to replace with defam
var str="123.This is,, :ravi"
The above line should be converted as follows
var newstr="123-This-is-ravi";
I tried this
function remove(str){ str.replace(/\./g, "-"); }
Can someone help me do this? I need to replace special characters with a hyphen.
user1831498
source share