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,479
  • 2
  • 30
  • 60

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
  • 20,481
  • 7
  • 40
  • 51
1

Please try below code:-

var yourCase= '$okay$';
var result= yourCase.replace(/\$/g, '');

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

Neel
  • 11,427
  • 3
  • 42
  • 60