1

Is there a version of Apache's StringUtils.replaceEach() that returns a StringBuilder or StringBuffer instead of String? I'd like to avoid copying code. If not, is there another library?

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
Josh Unger
  • 6,717
  • 6
  • 33
  • 55

1 Answers1

0

All of StringUtils's methods return Strings. You could, however, always do something like this:

StringBuilder builder = 
    new StringBuilder(StringUtils.replaceEach(myString, searchList, replaceList));
Mureinik
  • 297,002
  • 52
  • 306
  • 350