日期:2014-05-20 浏览次数:20699 次
String as = "0005123450003123000812345678";
while (as.length()>0){
int strCount=Integer.valueOf(as.substring(0, 4));
String res=as.substring(4, 4+strCount);
//out print your string
System.out.println(res);
as=as.substring(4+strCount, as.length());
}
public static void main(String[] args){
String str = "0005123450003123000812345678";
while(str.length() > 0){
int len = Integer.parseInt(str.substring(0,4));
String sub = str.substring(4,4+len);
System.out.println(sub);
str = str.substring(4+len);
}
}