Java String Implode implode(String glue, String... parts)

Here you can find the source of implode(String glue, String... parts)

Description

implode

License

Creative Commons License

Declaration

public static String implode(String glue, String... parts) 

Method Source Code

//package com.java2s;
// The license under which this software is released can be accessed at:

public class Main {
    public static String implode(String glue, String... parts) {
        if ((glue == null) || (parts.length <= 0)) {
            return "";
        }// w  w w .  ja v  a  2  s  .  c  o m
        String string = parts[0];
        for (int i = 1; i < parts.length; i++) {
            string += glue + parts[i];
        }
        return string;
    }
}

Related

  1. implode(Object[] data, String delimiter)
  2. implode(Object[] elements, String delimiter)
  3. implode(Object[] source, String delimiter)
  4. implode(String delim, Object[] array)
  5. implode(String delimiter, String[] strings)
  6. implode(String glue, String[] inputArray)
  7. implode(String glue, String[] pieces)
  8. implode(String glue, String[] pieces)
  9. implode(String glue, String[] strArray)