Java String Implode implode(String[] array, String glue)

Here you can find the source of implode(String[] array, String glue)

Description

implode

License

Apache License

Declaration

public static String implode(String[] array, String glue) 

Method Source Code

//package com.java2s;
/**/*ww  w. java2 s.  c o  m*/
 * From apache commons, Apache Software License v2
 */

public class Main {
    public static String implode(String[] array, String glue) {

        String out = "";

        if (array.length == 0) {
            return out;
        }

        for (Object part : array) {
            out = out + part + glue;
        }
        out = out.substring(0, out.length() - glue.length());

        return out;
    }
}

Related

  1. implode(String separator, String... data)
  2. implode(String... strings)
  3. implode(String[] args)
  4. implode(String[] arr_str, String pemisah)
  5. implode(String[] array, char delimiter)
  6. implode(String[] array, String separator)
  7. implode(String[] array, String separator)
  8. implode(String[] data, String delimiter)
  9. implode(String[] input)