2

I have a variable which contains the following string

placeholder = "<strong>Total Damage:</strong> $70,000.00"

Now, I am trying to replace Dollor sign($) with pound sign(£). Any idea how this can be done?

[Edit]

I don't know javascript, still trying to learn. now the solution seems so simple, I feel embarrassed now. Sorry for bothering everyone with such silly question :(

CuriousMind
  • 33,537
  • 28
  • 98
  • 137

3 Answers3

4
placeholder = placeholder.replace("$","£");

Simples!

Jamiec
  • 133,658
  • 13
  • 134
  • 193
3

Really?

JavaScript Replace

var myNewString = myOldString.replace("something", "new thing");

Jordan
  • 31,971
  • 6
  • 56
  • 67
2
placeholder = "<strong>Total Damage:</strong> $70,000.00".replace("$","£");
Nope
  • 22,147
  • 7
  • 47
  • 72