Java按指定字符切割字符串
程序员文章站
2022-07-14 12:13:55
...
@Test
public void getStringList(){
String str = "begin&我是1&我是2&我是3";
String[] strlist = str.split("&");
System.out.println(strlist.length);
for(String s : strlist){
System.out.println(s);
}
}