Class StringReplacer

java.lang.Object
org.eblocker.server.common.util.StringReplacer

public class StringReplacer extends Object
Faster string replacement for multiple replacements than using a loop and String.replace or Apache Commons StringUtils.replace

Internally it builds a trie of search strings and iterates input characters stopping at the next match.

Example usage:

     new StringReplacer()
         .add("first", "1st")
         .add("second", "2nd")
         .add("third", "3rd")
         .replace("first second third")