11.如何把一段逗号分隔的字符串转换为一个数组

split

public class DouHaoShuZuFenGe {
    public static void main(String[] args) {
        String orgStr = "a,b,c,d,e,f,g";
        String[] result = orgStr.split(",");

        for (int i = 0; i < result.length; i++) {
            System.out.print(result[i] + "	");
        }

        for (String s : result) {
            System.out.print(s);
        }
    }
}
signature:祸兮福所倚,福兮祸所伏
原文地址:https://www.cnblogs.com/xnuuuu/p/12163388.html