Since Java 8:

String.join(",", slist);

From Apache Commons library:

import org.apache.commons.lang3.StringUtils

Use:

StringUtils.join(slist, ',');

Another similar question and answer here

Answer from BobTheBuilder on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › java string › convert a list to a comma-separated string
Convert a List to a Comma-Separated String | Baeldung
July 2, 2025 - Lastly, we’ll see how to use the reduce() method to convert the list instead of the collect(): String commaSeparatedUsingReduce = arraysAsList.stream() .reduce((x, y) -> x + "," + y) .get(); assertThat(commaSeparatedUsingReduce).isEqualTo("ONE,TWO,THREE"); Alternatively, we can also use the utility classes provided by the Apache Commons Lang library instead of the Java ones.
🌐
GeeksforGeeks
geeksforgeeks.org › java › convert-a-list-of-string-to-a-comma-separated-string-in-java
Convert a List of String to a comma separated String in Java - GeeksforGeeks
January 23, 2026 - In Java, a List<String> can be efficiently converted into a comma-separated String using built-in utilities like String.join(), which concatenates list elements with a specified delimiter while ensuring clean, readable, and loop-free code.
🌐
Medium
medium.com › @AlexanderObregon › turning-a-java-list-into-a-comma-separated-string-efc1b6c44d1b
Turning a Java List into a Comma-Separated String | Medium
June 20, 2025 - Learn how to turn a Java List into a comma-separated string using loops, StringBuilder, and String.join, with a close look at how each method works internally.
🌐
TutorialsPoint
tutorialspoint.com › article › java-program-to-convert-a-list-of-string-to-comma-separated-string
Java program to convert a list of string to comma separated string
August 26, 2025 - Original List: [Java, Python, JavaScript, C++, Swift] Comma-Separated String: Java, Python, JavaScript, C++, Swift · In Java 8 and later, we can use the method Collectors.joining() from the Streams API to convert a list of strings to a comma-separated string.
🌐
Medium
medium.com › @alxkm › converting-a-list-of-strings-to-a-comma-separated-string-in-java-multiple-approaches-ebb86745c889
Java Interview: Converting a List of Strings to a Comma-Separated String in Java: Multiple Approaches | by Alex Klimenko | Medium
August 9, 2025 - StringBuilder sb = new StringBuilder(); for (int i = 0; i < names.size(); i++) { sb.append(names.get(i)); if (i < names.size() - 1) { sb.append(","); } } String result = sb.toString(); System.out.println(result); // Output: Alice,Bob,Charlie · Works in all Java versions.
🌐
DZone
dzone.com › coding › java › convert a list to a comma-separated string in java 8
Java 8: Convert a List to a Comma-Separated String
June 29, 2016 - package net.reversecoding.examples; import static java.util.stream.Collectors.joining; import static org.junit.Assert.assertEquals; import java.util.Arrays; import java.util.List; import org.junit.Test; public class CsvUtil { private static final String SEPARATOR = ","; public static String toCsv(List < String > listToConvert) { return String.join(SEPARATOR, listToConvert); } @Test public void toCsv_csvFromListOfString() { List < String > cities = Arrays.asList( "Milan", "London", "New York", "San Francisco"); String expected = "Milan,London,New York,San Francisco"; assertEquals(expected, toCs
🌐
Coderanch
coderanch.com › t › 433460 › java › Convert-List-comma-delimited-string
Convert List to comma delimited string (Beginning Java forum at Coderanch)
The only way I see to do it is either with the Iterator above, or with a foreach and getting rid of the comma at the end of the string after you exit the loop. Is there a similar way to do this in a foreach loop?
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › java › convert-arraylist-to-comma-separated-string-in-java
Convert ArrayList to Comma Separated String in Java - GeeksforGeeks
July 23, 2025 - We can convert ArrayList to a comma-separated String using StringJoiner which is a class in java.util package which is used to construct a sequence of characters(strings) separated by a delimiter and optionally starting with a supplied prefix ...
🌐
Medium
biniamasnake.medium.com › a-one-liner-code-to-convert-comma-separated-strings-to-list-in-java-a80106493a28
A one-liner code to convert comma-separated Strings to List in Java - Biniam Asnake - Medium
March 1, 2021 - Java · Csv File · Biniam Asnake · Mar 1, 2021 · -- Listen · Share · No talking! Let’s just do the code. // String that is comma separated String listOfUserIds = “10,11,12,13”;// The magic that converts it to list List<String> userIds = new ArrayList<String>(Arrays.asList(listOfUserIds.split(“,”))); To convert the List back to String: userIdsLists = userIds.join(', ') Originally published at http://binyit.blogspot.com.
🌐
GeeksforGeeks
geeksforgeeks.org › java › how-to-convert-a-comma-separated-string-into-an-arraylist-in-java
How to Convert a Comma-Separated String into an ArrayList in Java? - GeeksforGeeks
November 16, 2024 - In Java, to convert a comma-separated string into ArrayList, we can use the split() method to break the string into an array based on the comma delimiter. Another method we can also use Java Streams for a functional approach to achieve the same ...
🌐
Codemia
codemia.io › knowledge-hub › path › how_to_convert_comma-separated_string_to_list
How to convert comma-separated String to List?
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
Blogger
javahungry.blogspot.com › 2023 › 04 › comma-separated-string-to-list.html
Convert Comma-Separated String to List in Java [3 ways] | Java Hungry
There are 3 ways to achieve our goal of converting comma-separated String to List: 1. Using Java 8 Stream API 2. Using String's split() and Arrays
🌐
Mendix
community.mendix.com › link › spaces › app-development › questions › 114181
How to convert Comma Separated value ABC,EFG to List ...
March 31, 2022 - The Mendix Forum is the place where you can connect with Makers like you, get answers to your questions and post ideas for our product managers.
🌐
Attacomsian
attacomsian.com › blog › java-string-with-separator-to-list
Convert a comma-separated string to a list in Java
October 29, 2022 - Learn about 3 different ways to convert a comma-separated string to a list in Java.
🌐
Medium
medium.com › @AlexanderObregon › splitting-a-string-by-comma-in-java-the-right-way-1d3aa2aff1fa
Splitting a String by Comma in Java the Right Way | Medium
June 26, 2025 - Learn how Java splits comma-separated strings, trims spaces, handles regex, and safely processes input in arrays and lists without common parsing errors.
🌐
Simplesolution
simplesolution.dev › java-convert-comma-separated-string-to-list
Java Convert Comma Separated String to List
*/ public static List<String> commaSeparatedStringToList(String commaSeparatedString) { if(commaSeparatedString == null) { return null; } String[] values = commaSeparatedString.split(","); return Arrays.asList(values); } } In the following example Java code, we learn how to use the above utility class to convert a comma separated String into a List of Strings in Java program.
🌐
TutorialsPoint
tutorialspoint.com › how-to-convert-comma-seperated-java-string-to-an-array
How to convert comma seperated java string to an array.
public class Tester { public static void main(String[] args) { String text = "This,is,a,comma,seperated,string."; String[] array = text.split(","); for(String value:array) { System.out.print(value + " "); } } }
🌐
Javatpoint
javatpoint.com › convert-a-list-of-string-to-a-comma-separated-string-in-java
Convert a List of String to a comma separated String in Java - Javatpoint
Given a list of strings, the task is to convert a list of strings into a string that is separated by commas. It is a common task in Java that comes up frequently while working with formatting and data processing is converting a list of strings to a comma-separated string.