code: public static String replaceAnyOf(String value, String chars,
                                      char replacement) {
      char[] tmp = new char[value.length()];
      int pos = 0;
      for (int ix = 0; ix < tmp.length; ix++) {
        char ch = value.charAt(ix);
        if (chars.indexOf(ch) != -1)
          tmp[pos++] = replacement;
        else
          tmp[pos++] = ch;
      }
      return new String(tmp, 0, tmp.length);
    }
docs: Replaces all characters in the second parameter found in the first
  parameter with the final character.
  @param value the string to replace characters in
  @param chars the characters to replace
  @param replacement the character to insert as replacement