I have a large string that needs to be replaced several times. For instance,
var str="Username:[UN] Location:[LC] Age:[AG] ... " str=str.replace("[UN]","Ali") str=str.replace("[LC]","Turkey") str=str.replace("[AG]","29") ...
Is there a way to set FIND and REPLACE parameters to an array and replace them immediately? For instance:
reps = [["UN","Ali"], ["LC","Turkey"], ["AG","29"], ...] $(str).replace(reps)
source share