Java tutorial
//package com.java2s; import java.util.List; public class Main { public static String list2String(List<String> list, String spaceCharacter) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < list.size(); i++) { sb.append(list.get(i)); if (i != list.size() - 1) { sb.append(spaceCharacter); } } return sb.toString(); } }