Java Array Join join(String[] x)

Here you can find the source of join(String[] x)

Description

Join into string

License

Open Source License

Declaration

public static String join(String[] x) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    /** Join into string */
    public static String join(String[] x) {
        StringBuilder sb = new StringBuilder();
        for (String token : x) {
            sb.append(token).append(" ");
        }/*from   ww w  .  j a v a  2s .  c o  m*/
        return sb.toString().trim();
    }

    /** Join into string */
    public static String join(List<String> x) {
        StringBuilder sb = new StringBuilder();
        for (String token : x) {
            sb.append(token).append(" ");
        }
        return sb.toString().trim();
    }
}

Related

  1. join(String[] strParts, String glue)
  2. join(String[] strs)
  3. join(String[] strs, String glue, int start, int end)
  4. join(String[] tokens, String delimiter)
  5. join(String[] tokens, String separator)
  6. join(String[]... arrays)
  7. join(String[]... values)
  8. join(T[] a, T[] b)
  9. join(T[] arr1, T[] arr2)