日期:2014-05-20 浏览次数:20677 次
import java.util.Arrays;我想把字符串拆分成[TOM:89, JERRY:90, TONY:78],但上面的代码运行出来确是
public class StringDemo {
public static void main(String[] args) {
String str = "TOM:89|JERRY:90|TONY:78";
String[] newstr = str.split("|");
System.out.println(Arrays.toString(newstr));
}
}