001    /**
002     * Implements the Cold Fusion Function replacelist
003     */
004    package railo.runtime.functions.string;
005    
006    import railo.commons.lang.StringList;
007    import railo.commons.lang.StringUtil;
008    import railo.runtime.PageContext;
009    import railo.runtime.ext.function.Function;
010    import railo.runtime.type.List;
011    
012    public final class ReplaceList implements Function {
013            
014            public static String call(PageContext pc , String str, String list1, String list2) {
015    
016            StringList l1 = List.toListTrim(list1,',');
017            StringList l2 = List.toListTrim(list2,',');
018            
019            
020            while(l1.hasNext()) {
021                str=StringUtil.replace(str,l1.next(),((l2.hasNext())?l2.next():""),false);
022            }
023                    return str;
024            }
025    }