Posted on 2009-07-20 09:27
java人生 阅读(168)
评论(0) 编辑 收藏 所属分类:
javaSE
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
String reg = "##12";
System.out.println("++" + reg);
String[] s = reg.split("#{1,}");
System.out.println(s.length);
for (int a = 0; a < s.length; a++) {
System.out.println(s[a]);
}
String reg1 = "12";
System.out.println("++" + reg1);
String[] s1 = reg1.split("#{1,}");
System.out.println(s1.length);
for (int a = 0; a < s1.length; a++) {
System.out.println(s1[a]);
}
String reg2 = "##";
System.out.println("++" + reg2);
String[] s2 = reg2.split("#{1,}");
System.out.println(s2.length);
for (int a = 0; a < s2.length; a++) {
System.out.println(s2[a]);
}
}
}