Java Array to String arrayToString(String[] lines, String separator)

Here you can find the source of arrayToString(String[] lines, String separator)

Description

array To String

License

Open Source License

Declaration

static String arrayToString(String[] lines, String separator) 

Method Source Code

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

public class Main {
    static String arrayToString(String[] lines, String separator) {
        StringBuilder builder = new StringBuilder();
        String prefix = "";
        for (String s : lines) {
            builder.append(prefix).append(s);
            prefix = separator;/*from   www.j  a  v  a2 s  .c  om*/
        }
        return builder.toString();
    }

    static String arrayToString(String[] lines) {
        return arrayToString(lines, "\n");
    }
}

Related

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