手记

通过指定字符分割成字符串

    public static String[] delimStr(String str, String delim) {
        if (str == null || delim == null) {
            return null;
        }
        StringTokenizer token = new StringTokenizer(str, delim);
        String[] strings = new String[token.countTokens()];
        for (int i = 0; i < strings.length; i++) {
            strings[i] = token.nextToken();
        }
        return strings;
    }
0人推荐
随时随地看视频
慕课网APP