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 56 times
0

FeelRightz
- 2,777
- 2
- 38
- 73
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
- 21,229
- 7
- 44
- 54
1
Please try below code:-
var yourCase= '$okay$';
var result= yourCase.replace(/\$/g, '');

Neel
- 11,625
- 3
- 43
- 61