Android String Array Join join(String[] s, String glue)

Here you can find the source of join(String[] s, String glue)

Description

join

License

Open Source License

Declaration

public static String join(String[] s, String glue) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    public static String join(List<String> list, String glue) {
        return join(list.toArray(new String[0]), glue);
    }/*from ww w.ja  v  a2 s .co m*/

    public static String join(String[] s, String glue) {
        int k = s.length;
        if (k == 0)
            return null;
        StringBuilder out = new StringBuilder();
        out.append(s[0]);
        for (int x = 1; x < k; ++x)
            out.append(glue).append(s[x]);
        return out.toString();
    }
}

Related

  1. makeDivideString(String[] arr_str, String divide_str)
  2. join(String spliter, Object[] arr)
  3. joinStrings(String joiner, Iterable parts)
  4. join(String spliter, Object[] arr)
  5. join(String[] strings, String separator)
  6. join(String delimiter, String[] strings)
  7. join(int[] arr, String delimiter)
  8. join(String[] parts, String delimiter)
  9. join(String delimiter, Object... chunks)