0

For an example , $okay$ how to replace into okay ? I tried replace("/$",""); and get okay$ , how to remove both $ symbol ? Any suggestion ? Thanks

FeelRightz
  • 2,777
  • 2
  • 38
  • 73

2 Answers2

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, '');

Demo:- http://jsfiddle.net/Rj9bR/38/

Neel
  • 11,625
  • 3
  • 43
  • 61