onlinetutorialspoint.com
Java 8 How to Convert List to String comma separated values
Here we will see how to convert List to String comma separated values using Java 8. List to String Comma Separated: Let's take a simple java List, filled with Strings of elements. 1. List to String using String.join(): List countries = Arrays.asList("Java","Spring","Hibernate","Python","C"); String countrieswithComma = String.join(",",countries); System.out.println(countrieswithComma); Output: Java,Spring,Hibernate,Python,C 2. List to String comma separate using Streams: