手记

通过字符串的指定字符转成集合


    public static List<String> changeStrToListByReg(String str,String delim){
        List<String> list=null;
        if (StringUtils.isNotEmpty(str)) {  
            StringTokenizer tokenizer=new StringTokenizer(str, delim);
            int count=tokenizer.countTokens();
            if (count>1) {
                list=new ArrayList<String>();
                while (tokenizer.hasMoreTokens()) {
                    list.add(tokenizer.nextToken());
                }
            }

        }
        return list;
    }```
0人推荐
随时随地看视频
慕课网APP