I have the same result.double c characters.
So curious, String s = "a";
String a = s.replaceAll("[a]","c");
System.out.println(a);
So curious, String s = "a";
String a = s.replaceAll("[a]","c");
System.out.println(a);
解决方案 »
- 新手求教
- java初学用什么编辑器好
- 谁帮我解决一下一个异常问题
- [200分]为什么java.util.Date类型的值,打出来的总是Tue Oct 10 20:22:10 CST 2006
- 那位大大都帮我每行注释一下这段代码,我是的小菜鸟,谢谢
- 这个程序如何改?
- 对于图形绘制的一点不解,求教大家!
- 请问怎样为tree的不同叶子设计不同的图标??
- 可怜我吧!就这么多分了!!各位!在tomcat 4.0.1和tomcat 4.0.2中怎么样建立一个新的虚拟目录????
- 求助:"错误:com/borland/jbcl/layout/XYLayout"应如何解决?
- 如何将Delphi中的加密解密程序改写java的加密解密程序?(源代码奉献,问题解决分可以再加)
- 请问如何限制JTable的某一列只能输入数字,也就是这一列的Editor该怎么写?有例子就给分
String a = "aaaa$aaaaa";
String[]b = a.split("$");
System.out.print(b.length);大家猜想,树出多少?
String s = "";
String a = s.replaceAll("a*","c");
System.out.println(a);打印出来的是 c
知道那个*号在这里做什么事的吧用 String a=s.replaceAll("a+","c");
就可以得到正确结果了。
Caze $ character binds the end of line.
So the spilt method would find the end of line,then only return 1 and only one String array.