将Java字符串拆分为管道符号,使用Split(“AC.26”)
"boo:and:foo"
{ "boo", "and", "foo" }"public static void main(String[] args){
String test = "A|B|C||D";
String[] result = test.split("|");
for(String s : result){
System.out.println(">"+s+"<");
}
}><>A<>|<>B<>|<>C<>|<>|<>D<
>A<>B<>C<><>D<
眼眸繁星
慕容森
相关分类