Here you can find the source of convertListToString(String[] stringList)
public static String convertListToString(String[] stringList)
//package com.java2s; //License from project: Open Source License import java.util.StringJoiner; public class Main { /**/*w ww. jav a 2 s . c o m*/ * Given a string list, gets the text from the list in the following manner: * apple, pear, pineapple */ public static String convertListToString(String[] stringList) { if (stringList == null || stringList.length == 0) { return ""; } StringJoiner stringJoiner = new StringJoiner(", "); for (String string : stringList) { stringJoiner.add(string); } return stringJoiner.toString(); } }