标签:
//String[] aa = "aaa|bbb|ccc".split("|");//错误 String[] aa = "aaa|bbb|ccc".split("\\|"); //正确 for (int i = 0 ; i <aa.length ; i++ ) { System.out.println("--"+aa[i]); }
“.”和“|”都是转义字符,必须得加"\\";
标签:
原文地址:http://www.cnblogs.com/jiduoduo/p/5768472.html