http://xiangai.taobao.com
http://shop148612228.taobao.com

List<String>与逗号分隔的字符串互转

将逗号分隔的字符串转换为List

    List<String> list = Arrays.asList(str.split(","));

    List<String> list = Arrays.asList(StringUtils.split(str, ","));

将list转化为逗号分割的字符串

    String str = String.join(",", list);

    String str = StringUtils.json(list.toArray(), ",");    

posted @ 2020-11-14 13:29  万事俱备就差个程序员  阅读(1816)  评论(0编辑  收藏  举报

http://xiangai.taobao.com
http://shop148612228.taobao.com
如果您觉得对您有帮助.领个红包吧.谢谢.
支付宝红包
微信打赏 支付宝打赏