Here you can find the source of arrayToString(String[] input)
Parameter | Description |
---|---|
input | The Array of Strings to be converted. |
public static String arrayToString(String[] input)
//package com.java2s; /*// ww w.ja v a2s . c o m * Filename: CLIHelper.java * * Copyright 2015 Jean-Pierre Hoehmann (jeanpierre.hoehmann@gmail.com) * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want * To Public License, Version 2, as published by Sam Hovecar. See * http://www.wtfpl.net/ for more details. */ public class Main { /** * Helper method used to convert an Array of Strings into one multiline String. * * @param input * The Array of Strings to be converted. * @return The converted String. */ public static String arrayToString(String[] input) { String output = ""; // Iterate over the array and append each line including a line feed to the output. // This will produce a String with a trailing newline. // Restoration of the original String is not possible, // because stringToArray simply strips trailing newlines for easier formatting. for (int i = 0; i < input.length; i++) { output += input[i]; output += System.lineSeparator(); } return output; } }