Android examples for java.lang:StringBuilder
Join array To String via StringBuilder
import android.annotation.SuppressLint; import java.text.SimpleDateFormat; import java.util.Date; public class Main{ public static String arrayToString(String[] array, String separator) { if (array == null || array.length == 0) { return ""; }// w w w .j a v a 2 s.co m StringBuilder result = new StringBuilder(); for (String temp : array) { result.append(temp).append(separator); } return result.substring(0, result.length() - 2); } }