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 "";
        }/*w w w. ja  va  2  s.c o 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. join(String spliter, Object[] arr)
  5. joinStrings(String joiner, Iterable parts)
  6. join(String[] strings, String separator)
  7. join(String[] s, String glue)
  8. join(String delimiter, String[] strings)
  9. join(int[] arr, String delimiter)