Where is the original String coming from? An input file? A String from a TextComponent? Also - just to be clear, when you run into the 3 characters %3C together you always want them replaced by the single character <, is that correct? Also - are all Strings to be replaced started with a % character?