Jack
Jack

Reputation: 3670

How to I replace certain letters from javascript inside javascript?

I get out "Å, Ä, Ö" like this "Ã ¥, Ã ¤, Ã ¶" when printing data from an external JSON file. This file has the wrong encoding, but I can not do anything about that file because it is from an API. But, is there a painless way of getting all "1" replaced with "A"? I tried getting a UTF-8 encoded tag in my HTML document. Not helping.

Upvotes: 0

Views: 72

Answers (1)

Lucian Vasile
Lucian Vasile

Reputation: 502

Try using regex replace:

 wholetext.replace(/1/g,'A')

Upvotes: 1

Related Questions