class Const {

  public static void repl( StringBuffer str, String code, String repl ) {
    if ( ( code == null ) || ( repl == null ) || ( code.length() == 0 ) || ( repl.length() == 0 ) || ( str == null ) || ( str.length() == 0 ) ) {
      return; // do nothing
    }
    String aString = str.toString();
    str.setLength( 0 );
    str.append( aString.replaceAll( Pattern.quote( code ), Matcher.quoteReplacement( repl ) ) );
  }

}