Java Array to String arrayToString(String[] ngram)

Here you can find the source of arrayToString(String[] ngram)

Description

Convert an array to a String using spaces as glue

License

Open Source License

Parameter

Parameter Description
ngram The array to convert

Return

The String

Declaration

public static String arrayToString(String[] ngram) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*  w w  w. j  av a2s  . c  o m*/
     * Convert an array to a String using spaces as glue
     * 
     * @param ngram The array to convert
     * @return The String
     */
    public static String arrayToString(String[] ngram) {
        String ret = "";
        for (String aNgram : ngram) {
            ret += ngram + " ";
        }
        return ret.trim();
    }
}

Related

  1. arrayToString(String[] array, String separators)
  2. arrayToString(String[] arrayString, String splitStr)
  3. arrayToString(String[] input)
  4. arrayToString(String[] lengthsAndDelimiters)
  5. arrayToString(String[] lines, String separator)
  6. arrayToString(String[] object)
  7. arrayToString(String[] s, String delim)
  8. arrayToString(String[] str, char sep)
  9. arrayToString(String[] str, String separator)