replace all special character in string javascript....? -
why not replace ?
code:
var str = "fq$team$456$$$$fq$plrs$4789"; if(str.indexof("$$$$")>=0){ str = str.replace("$$$$","$$"); } // gives fq$team$456$fq$plrs$4789 // expected output = fq$team$456$$fq$plrs$4789
according mdn docs, $$ supposed insert single $. result of $ character being used form special string patterns.
Comments
Post a Comment