For an example , $okay$ how to replace into okay ? I tried replace("/$",""); and get okay$ , how to remove both $ symbol ? Any suggestion ? Thanks
Asked
Active
Viewed 53 times
0
FeelRightz
- 2,479
- 2
- 30
- 60
2 Answers
3
You would use a regexp with g modifer, and note to escape the $ with \$:
var str = "$okay$";
str = str.replace(/\$/g,"");
Spencer Wieczorek
- 20,481
- 7
- 40
- 51
1
Please try below code:-
var yourCase= '$okay$';
var result= yourCase.replace(/\$/g, '');
Neel
- 11,427
- 3
- 42
- 60