A javascript function which functions the same as the @replace function
function replace(sourcelist,fromlist,tolist) { //@Replace( sourcelist ; fromlist ; tolist ) //fromlist and tolist need to be array's if (fromlist[0]==null || tolist[0]==null) { alert('fromlist and tolist needs to be arrays') return sourcelist } for (i = 0; i < fromlist.length; i++ ) { //Firt check if sourcelist is array or string if (sourcelist[0]==null) { // IsString if (fromlist[i] == sourcelist) return tolist[i]; } else { // IsArray for (j=0; j < sourcelist.length;j++) { if (fromlist[i] == sourcelist[i]) sourcelist[i] = tolist[i]; } } } return sourcelist }
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
This was first published in October 2002