N
namemattersnot
Here's my code:
###
myvar = "test1_1;test2_1;test3_1";
myvar = myvar.replace(/_1/g, "_2")';
###
it works just fine. if I introduce "cat = 1", how do I change my
replace function so that instead of replacing a fixed "1" value, I
would use "cat"?
myvar = myvar.replace('/_'+cat'/g', "_2")' does not work.
Thanks!
###
myvar = "test1_1;test2_1;test3_1";
myvar = myvar.replace(/_1/g, "_2")';
###
it works just fine. if I introduce "cat = 1", how do I change my
replace function so that instead of replacing a fixed "1" value, I
would use "cat"?
myvar = myvar.replace('/_'+cat'/g', "_2")' does not work.
Thanks!