Android String Array Join makeDivideString(String[] arr_str, String divide_str)

Here you can find the source of makeDivideString(String[] arr_str, String divide_str)

Description

make Divide String

License

Apache License

Declaration

public static String makeDivideString(String[] arr_str,
            String divide_str) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String makeDivideString(String[] arr_str,
            String divide_str) {/*from  w w w .  j av a 2s. c  o  m*/
        if (arr_str == null)
            return null;
        if (arr_str.length == 0)
            return "";
        StringBuilder sb = new StringBuilder();
        for (String e : arr_str) {
            sb.append(e);
            sb.append(divide_str);
        }
        sb.delete(sb.length() - divide_str.length(), sb.length());
        return sb.toString();
    }
}

Related

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