Java 将 List<Long> 转换为逗号分隔的字符串
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33409592/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Converting a List<Long> to comma separated string
提问by user2375298
Hi I am having a requirement where I need to convert List
of Long
datatype to comma separated String
.
Which would be the appropriate way. I have thought about using string builder or converting it to List<String>
and then using StringUtils
join to get a String
.
嗨,我有我需要转换的要求List
的Long
以逗号分隔的数据类型String
。这将是适当的方式。我曾考虑使用字符串生成器或将其转换为List<String>
然后使用StringUtils
join 来获取String
.
I am looking for java 7
solution,Not using guava
or java 8
.
我正在寻找java 7
解决方案,不使用guava
或java 8
。