日期:2014-05-20 浏览次数:20775 次
public static void main(String[] args) throws IOException {
System.out.println(replace("csdnjavase", "d*j", "help"));
System.out.println(replace("csdnjavase", "d***v", "help"));
}
private static String replace(String str, String old, String with){
old = old.replaceAll("\\*", ".");
return str.replaceAll(old, with);
}