Here you can find the source of convertChars(String orig_name, String chars, char toChar)
public static String convertChars(String orig_name, String chars, char toChar)
//package com.java2s; public class Main { public static String convertChars(String orig_name, String chars, char toChar) { StringBuffer tmp = new StringBuffer(orig_name); int i;//from w w w . j a v a 2 s.co m for (i = 0; i < tmp.length(); i++) { if (chars.indexOf(tmp.charAt(i)) != -1) { tmp.setCharAt(i, toChar); } } return new String(tmp); } }