snowtown
02-13-2003, 04:29 PM
Hi!
I'm having trouble replacing words in a string n times. The code I have is the following:
...
s.replace(RegExp(foo), bar);
...
Where foo (which is a variable) is to be replaced n times by the word bar (which also is a variable).
So my question is: Where, and how, do I put the n into the code above?
Thanks!
I'm having trouble replacing words in a string n times. The code I have is the following:
...
s.replace(RegExp(foo), bar);
...
Where foo (which is a variable) is to be replaced n times by the word bar (which also is a variable).
So my question is: Where, and how, do I put the n into the code above?
Thanks!