Here you can find the source of arrayToStringWithPrefix(T[] array, String splitter, String prefix)
public static <T> String arrayToStringWithPrefix(T[] array, String splitter, String prefix)
//package com.java2s; //License from project: Apache License public class Main { public static <T> String arrayToStringWithPrefix(T[] array, String splitter, String prefix) { return prefix + arrayToString(array, splitter + prefix); }/*w w w.j a va 2 s . c om*/ public static <T> String arrayToString(T[] array, String splitter) { if (array == null) return null; if (array.length == 0) return ""; StringBuilder stringBuilder = new StringBuilder(array[0].toString()); for (int i = 1; i < array.length; i++) { stringBuilder.append(splitter); stringBuilder.append(array[i]); } return stringBuilder.toString(); } public static <T> String arrayToString(T[] array) { return arrayToString(array, ", "); } }