Bootstrap

java根据特定字符分割String字符串

String item=“a,a_content;b,b_content;c,c_content”;

ArrayList<String> mArrayList = new ArrayList<String>();

String[] splitStrings = item.split(";");
            for (int i = 0; i < splitStrings.length; i++) {
                String itemString = splitStrings[i];
                mArrayList.add(itemString);
            }

最后得到分割后的字符串数组

转载于:https://my.oschina.net/u/990728/blog/393754

;