Here you can find the source of arrayToString(String[] arr)
Parameter | Description |
---|---|
arr | the array to serialize |
public static String arrayToString(String[] arr)
//package com.java2s; public class Main { /**/*from www. j a v a 2s. c o m*/ * Helper method serlializing an array as string using "/" as separator. * If the array is <code>null</code> or empty, the string <i><no values specified></i> * is returned. * @param arr the array to serialize * @return the string concatenation of the values in the array * @aribaapi private */ public static String arrayToString(String[] arr) { if (arr != null && arr.length > 0) { StringBuilder builder = new StringBuilder(); for (int i = 0; i < arr.length; i++) { builder.append(arr[i]); if (i < arr.length - 1) { builder.append("/"); } } return builder.toString(); } else { return "<no values specified>"; } } }