I have a large string which need be replaced a few times. Such as
var str="Username:[UN] Location:[LC] Age:[AG] ... "
str=str.replace("[UN]","Ali")
str=str.replace("[LC]","Turkey")
str=str.replace("[AG]","29")
...
//lots of replace
...
Is there a way to put those FIND and REPLACE parameters to an array, and replace all of them at once? Such as:
reps = [["UN","Ali"], ["LC","Turkey"], ["AG","29"], ...]
$(str).replace(reps)