Android String Array Join join(String spliter, Object[] arr)

Here you can find the source of join(String spliter, Object[] arr)

Description

join

Declaration

public static String join(String spliter, Object[] arr) 

Method Source Code

//package com.java2s;

public class Main {
    public static String join(String spliter, Object[] arr) {
        if (arr == null || arr.length == 0) {
            return "";
        }//from   w w w . j a  v  a 2  s  .co m
        if (spliter == null) {
            spliter = "";
        }
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < arr.length; i++) {
            if (i == arr.length - 1) {
                break;
            }
            if (arr[i] == null) {
                continue;
            }
            builder.append(arr[i].toString());
            builder.append(spliter);
        }
        return builder.toString();
    }
}

Related

  1. implode(String[] strings, String glue)
  2. concatenate(String[] elements, String delimiter)
  3. makeDivideString(String[] arr_str, String divide_str)
  4. joinStrings(String joiner, Iterable parts)
  5. join(String spliter, Object[] arr)
  6. join(String[] strings, String separator)
  7. join(String[] s, String glue)