Here you can find the source of arrayToDelimitedString(Object[] arr, String delim)
Parameter | Description |
---|---|
Object | [] |
public static String arrayToDelimitedString(Object[] arr, String delim)
//package com.java2s; public class Main { public static String arrayToDelimitedString(Object[] arr, String delim) { if (arr == null || arr.length == 0) { return ""; }/*from w w w . j a va 2 s . co m*/ StringBuffer sb = new StringBuffer(); for (int i = 0; i < arr.length; i++) { if (i > 0) { sb.append(delim); } sb.append('\''); sb.append(arr[i]); sb.append('\''); } return sb.toString(); } }