Str = Str.replaceAll("A","B"); //将A用B替换掉
System.out.println(src.replaceAll("\\d","f"));=>abffafcffd. 就可以了。