How to replace round bracket tag in javascript string

Posted by tomaszs on Stack Overflow See other posts from Stack Overflow or by tomaszs
Published on 2010-03-19T09:06:27Z Indexed on 2010/03/19 9:11 UTC
Read the original article Hit count: 428

I have trouble with changing round bracket tag in Javascript. I try to do this:

var K = 1;
var Text = "This a value for letter K: {ValueOfLetterK}";
Text = Text.replace("{ValueOfLetterK}", K);

and after that I get:

Text = "This a value for letter K: {ValueOfLetterK}"

What can be done to make this work? When I remove round brackets it works fine.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about string