分类:
2008-09-09 12:42:05
public static void main(String args[]) {
String num[] = new String[11];
String sLine = "101494|360103660318444|2008/06/17|周润英|1292.0|3085.76|2778.28|912.91|106.0|||";
num = sLine.split("\\|");
int row = 1;
for (String s : num) {
System.out.println(row+++"="+s);
}
}
}
class T {
public static void main(String args[]) {
String num[] = new String[11];
String sLine = "101494|360103660318444|2008/06/17|周润英|1292.0|3085.76|2778.28|912.91|106.0|||";
num = sLine.split("\\|");
int row = 1;
for (String s : num) {
System.out.println(row+++"="+s);
}
}
}
最有有三个|||,运行结果为
1=101494
2=360103660318444
3=2008/06/17
4=周润英
5=1292.0
6=3085.76
7=2778.28
8=912.91
9=106.0
最有有三个|||,运行结果为
1=101494
2=360103660318444
3=2008/06/17
4=周润英
5=1292.0
6=3085.76
7=2778.28
8=912.91
9=106.0
public String[] split(String regex, int limit);