📜  拆分参数字符串并将标记添加到列表中 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:07.739000             🧑  作者: Mango

代码示例1
public List getTokens(String str) {
    List tokens = new ArrayList<>();
    StringTokenizer tokenizer = new StringTokenizer(str, ",");
    while (tokenizer.hasMoreElements()) {
        tokens.add(tokenizer.nextToken());
    }
    return tokens;
}