public class test05 {
public static void main(String[] args) {
String str ="张三:20|李四:21|王五:22";
String result[]=str.split("\\|");
for(int x=0;x<result.length;x++) {
String temp[]=result[x].split(":");
System.out.println("姓名:"+temp[0]+",年龄:"+temp[1]);
}
}
}
我想请教一下各位大佬,为什么这段代码在运行不了啊?要怎么修改才能顺利运行啊?求求了,救救孩子吧。。。