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
  • 32,657
  • 26
  • 90
  • 129

3 Answers3

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

Simples!

Jamiec
  • 128,537
  • 12
  • 134
  • 188
3

Really?

JavaScript Replace

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

Jordan
  • 30,837
  • 6
  • 53
  • 65
2
placeholder = "<strong>Total Damage:</strong> $70,000.00".replace("$","£");
Nope
  • 21,907
  • 7
  • 45
  • 72