Android examples for java.lang:String Join
join set of string to a string
import android.util.Log; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.Set; public class Main{ public static String join(Set<String> set, String delim) { if (set != null && delim != null) { StringBuilder sb = new StringBuilder(); String loopDelim = ""; for (String s : set) { sb.append(loopDelim);//from ww w .jav a 2 s.co m sb.append(s); loopDelim = delim; } return sb.toString(); } return null; } }