my string contains some variables which is given between @,eg:-(@name@)
.
Am passing variables values and storing it in an array. I want to replace this values with the variable in actual string.
This is my code
actual_string = actual_string.replace(new RegExp('@'+dynamic[i]+"@"),value);
This will replace only one value, If i have same variable repeatedly then the above code will replace only the first occurance. Then i tried
actual_string = actual_string.replace(new RegExp('/\@'+dynamic[i]+"\@/"),value);
But this is not even replacing single variable