Here you can find the source of toString(String[] arr, String delimiter)
Parameter | Description |
---|---|
arr | a parameter |
delimiter | a parameter |
public static String toString(String[] arr, String delimiter)
//package com.java2s; public class Main { /**//from ww w . j a v a2 s .c om * * @param arr * @param delimiter * @return */ public static String toString(String[] arr, String delimiter) { if (arr == null || arr.length == 0) { return ""; } if (delimiter == null) { delimiter = ","; } StringBuffer result = new StringBuffer(); result.append(arr[0]); for (int a = 1; a < arr.length; a++) { result.append(delimiter); result.append(arr[a]); } return result.toString(); } }