Lets say I have the following string in my javascript code:
var myText = 'Hello %1. How are you %2?';
Now I would like to inject something in place of %1 and %2 in the above string. I can do:
var result = myText.replace('%1', 'John').replace('%2', 'today');
I wonder if there is a better way of doing than calling 2 times the replace function.
Thanks.