Use one of the the StringUtils.join methods in Apache Commons Lang.

import org.apache.commons.lang3.StringUtils;

String result = StringUtils.join(list, ", ");

If you are fortunate enough to be using Java 8, then it's even easier...just use String.join

String result = String.join(", ", list);
Answer from Jeff Olson on Stack Overflow
🌐
Davidvlijmincx
davidvlijmincx.com › home › java › java stream join lists
Java Stream join lists
March 10, 2022 - The easiest way to join two lists with Streams is by using the Stream.concat(Stream a, Stream b) method. The method takes two Stream instances as parameters and puts the second Stream behind the first Stream. The result is a new list of strings with the content of both lists.
🌐
Coderwall
coderwall.com › p › im4lja › joining-objects-into-a-string-with-java-8-stream-api
Joining Objects into a String with Java 8 Stream API (Example)
July 17, 2023 - #join · #stream · You can leverage Java 8 Collectors to concatenate some objects into a string separated by a delimiter: For example: List<Integer> numbers = Arrays.asList( 4, 8, 15, 16, 23, 42 ); return numbers.stream() .map( n -> n.toString() ) .collect( Collectors.joining( "," ) ); will return "4,8,15,16,23,42".
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-8-streams-collectors-joining-method-with-examples
Java 8 Streams | Collectors.joining() method with Examples - GeeksforGeeks
January 22, 2026 - Collectors.joining() concatenates all the string elements into one single String. The final concatenated string is stored in chString. ... import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class GFG { ...
🌐
Medium
medium.com › javarevisited › nuanced-string-joining-in-java-7db547c331d0
Nuanced String Joining in Java | Javarevisited
April 23, 2024 - Stream<Integer> stream = Stream.of(numbers); We can also adapt it as an ArrayAdapter in Eclipse Collections. ArrayAdapter<Integer> adapted = ArrayAdapter.adapt(numbers); But what next? This is where our fun begins. I wrote an article for 97 Things Every Java Programmer Should Know with the title “Learn to Kata and Kata to Learn.” In this article, I iterate through some example Java code using Collectors.joining() and String.join() to create a comma separated list of names.
🌐
HowToDoInJava
howtodoinjava.com › home › java 8 › join or append stream elements in java
Join or Append Stream Elements in Java
December 13, 2024 - It works well when converting a collection or array of strings to a single string. The String.join() requires a collection or array as input, so we must convert the stream into a list using toList().
🌐
Baeldung
baeldung.com › home › java › java streams › string operations with java streams
String Operations with Java and Stream API | Baeldung
January 8, 2024 - Java 8 has introduced a new Stream API that lets us process data in a declarative manner. In this quick article, we would learn how to use the Stream API to split a comma-separated String into a list of Strings and how to join a String array into a comma-separated String.
🌐
Medium
medium.com › @ravindra.cse.tu › java-8-streams-joining-strings-with-delimiters-e641c6b42280
Java 8 Streams: Joining Strings with Delimiters | by Ravindra K Yadav | Medium
November 24, 2024 - package com.program.java8; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class Solution10 { public static void main(String[] args) { List<String> listString = Arrays.asList("Facebook","Apple","Microsoft"); String joinedString = listString.stream().collect(Collectors.joining(",","[","]")); System.out.println(joinedString); } } ... Declares a list named listString of type List<String>.
Find elsewhere
🌐
Javaprogramto
javaprogramto.com › 2020 › 12 › java-8-stream-join-string.html
Java 8 Streams - Join or Append Stream of Strings using Collectors.joining() JavaProgramTo.com
November 26, 2021 - Along with the joining, this method ... the default delimiter. Collectors.joining() method does concatenate the list of values or list of strings or stream of values or strings into a new string....
🌐
DEV Community
dev.to › prk0906 › join-a-list-of-strings-with-as-prefix-as-suffix-and-as-delimiter-using-streams-1lc3
Join a list of strings with '[' as prefix, ']' as suffix, and ',' as delimiter using streams. - DEV Community
April 4, 2026 - Step 1: Convert List → Stream -> languageList.stream() Step 2: Collecting using joining() Collectors.joining(delimiter, prefix, suffix)->.collect(Collectors.joining(",", "[", "]"))
🌐
Medium
nicksamoylov.medium.com › java-streams-29-collect-5-string-join-and-collectors-joining-668bca0d6079
Java streams 29. Collect 5. String.join() and Collectors.joining() | by Nick Samoylov | Medium
August 23, 2020 - If the values are presented as a fixed set of String values, we can use java.util.StringJoiner class or String.jojn() method: StringJoiner joiner = new StringJoiner(", ") .add("cat").add("fish").add("dog"); System.out.print(joiner); //prints: ...
🌐
Mkyong
mkyong.com › home › java › java – how to join list string with commas
Java – How to join List String with commas | mkyong.com
November 29, 2018 - package com.mkyong; import java.util.Arrays; import java.util.List; public class JavaStringExample1 { public static void main(String[] args) { List<String> list = Arrays.asList("a","b","c"); String result = String.join(",", list); System.out.println(result); } } ... package com.mkyong; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class JavaStringExample2 { public static void main(String[] args) { List<String> list = Arrays.asList("a", "b", "c"); String result = list.stream().collect(Collectors.joining(",")); System.out.println(result); } }
🌐
amitph
amitph.com › home › java › convert list to concatenated string with delimiter in java
List of Strings to Concatenated String with Delimiter in Java | amitph
November 22, 2024 - List<String> words = Arrays.asList("Convert", "List", "of", "Strings", "To", "String"); String output = String.join(",", words); System.out.println(output); // Output: // Convert,List,of,Strings,To,StringCode language: Java (java) Moreover, ...
🌐
Wordpress
ivarconr.wordpress.com › 2013 › 11 › 20 › java-8-joining-strings-with-stream-api
Java 8: joining strings with Stream API | Developer writing about stuff
November 20, 2013 - //Data List<Person> persons = new ArrayList<>(); persons.add(new Person("Ola Hansen", 21)); .. //Solution String names = persons.stream() .filter(p -> p.getAge() > 18) .sorted((p1, p2) -> p1.getAge() - p2.getAge()) .map(p -> p.getAge() + ":" + p.getName()) .collect(Collectors.joining(", ")); //Result "21:Ola Hansen, 28:Ivar Østhus, 29:Kari Normann, 42:Donald Duck"
🌐
Medium
medium.com › @AlexanderObregon › javas-collectors-joining-method-explained-a4adb120b785
Java’s Collectors.joining() Method Explained | Medium
November 2, 2024 - These include tasks such as combining user names into a readable string, constructing file paths, and assembling query parameters for URLs. Imagine you’re tasked with displaying a list of user names in a comma-separated format for display in a report or on a user interface. Instead of manually iterating through the list and concatenating the names, Collectors.joining() provides a cleaner and more readable solution. ... import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class UserNameJoiner { public static void main(String[] args) { List<String> users = Arrays.asList("Mason", "Chloe", "Liam", "Sophie"); String userDisplay = users.stream() .collect(Collectors.joining(", ", "User List: ", ".")); System.out.println(userDisplay); // Output: User List: Mason, Chloe, Liam, Sophie.
🌐
Medium
medium.com › @idiotN › collectors-joining-method-java-238e11bba996
Collectors.joining() method Java. It is a collector used with Java… | by idiot | Medium
April 19, 2025 - import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class JoiningExample { public static void main(String[] args) { List<String> names = Arrays.asList("Alice", "Bob", "Charlie"); String result = names.stream() .collect(Collectors.joining(", ")); System.out.println("Joined names: " + result); } } 🟢 Output: Joined names: Alice, Bob, Charlie ·
🌐
Blogger
javarevisited.blogspot.com › 2016 › 06 › 10-examples-of-joining-string-in-java-8.html
10 Examples of Joining String in Java - String.join vs StringJoiner
May 11, 2023 - List<String> typesOfLoan = Arrays.asList("home loan", "personal loan", "car loan", "balance transfer"); String loans = String.join(",", typesOfLoan); System.out.println("joining list elements: " + loans); Output home loan,personal loan,car loan,balance transfer You can see the result is a long String containing all elements of the given list, and each element is separated by a comma, the delimiter we have passed. JDK 8 also provides a joining Collector, which you can use to join String from a Stream, as shown below.
🌐
DEV Community
dev.to › satyam_gupta_0d1ff2152dcc › master-the-java-string-join-method-a-2025-guide-with-examples-best-practices-2oem
Master the Java String join() Method: A 2025 Guide with Examples & Best Practices - DEV Community
November 6, 2025 - The elements must be CharSequence ... first, often using Streams: java List numbers = List.of(1, 2, 3); String joined = numbers.stream().map(String::valueOf).collect(Collectors.joining("-")); // Or, simpler if you're sure about ...