Java String Implode implode(String[] array, char delimiter)

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

Description

implode the given array

License

Apache License

Declaration

public static String implode(String[] array, char delimiter) 

Method Source Code

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

public class Main {
    /** implode the given array */
    public static String implode(String[] array, char delimiter) {

        StringBuilder sb = new StringBuilder();
        for (String s : array) {
            sb.append(s).append(delimiter);
        }/*from   w w  w  . j ava  2 s  .c  om*/
        return (sb.length() == 0) ? ("") : (sb.substring(0, sb.length() - 1));

    }
}

Related

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