Android examples for java.lang:String Join
join CharSequence with array of tokens
import android.text.TextUtils; import java.net.URLDecoder; import java.net.URLEncoder; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Main{ /**/* w w w. j a va 2s. c om*/ * Returns a string containing the tokens joined by delimiters. * @param tokens an array objects to be joined. */ public static String join(CharSequence delimiter, int[] tokens) { StringBuilder sb = new StringBuilder(); boolean firstTime = true; for (Object token : tokens) { if (firstTime) { firstTime = false; } else { sb.append(delimiter); } sb.append(token); } return sb.toString(); } }