Monday, 25 November 2019

js replaceAll

https://stackoverflow.com/questions/1144783/how-to-replace-all-occurrences-of-a-string

string.replace(/key/g,"b");

for parameter you can do:


fileContent.replace(new RegExp(userName,'g'),"***");

No comments:

Post a comment