I can not give a single example of this because I could not figure out how it will work on its own.
All I want to do is take the string that was assigned to the value and use this as the match string for all matches.
var replacement = 'i'; var text = 'tieiam'; text = text.replace(replacement, ''); // 'teiam' text = text.replace(/tieiam/g, ''); // 'team'
How to use them together?
javascript replace global
Trevor bramble
source share