利用split对一个字符串按逗号“”,“”分割成数组

Stirng attach_id = "a,da,dsa,rew,rew,dsa";

String[] arr=new String(attach_id).split("[\\,]"); //用split对一个字符串按逗号分割成数组
String str = Arrays.toString(arr);    //str数组


posted @ 2019-12-19 15:34  up-zyn  阅读(4696)  评论(0编辑  收藏  举报