Converting a <Long> List to a Comma Separated String

Hi, I have a requirement when I need to convert Listfrom a Longdata type to comma separated String. That would be a suitable way. I thought about using a string builder or converting it to List<String>, and then using StringUtilsjoin to get String.

I am looking for a solution java 7without using guavaor java 8.

+4
source share
1 answer

You can try the following:

StringUtils.join(mylist, ',');
+7
source

Source: https://habr.com/ru/post/1613616/


All Articles