Here you can find the source of arrayToStr(Object[] arr, char split)
Parameter | Description |
---|---|
Object | [] |
split | a parameter |
public static String arrayToStr(Object[] arr, char split)
//package com.java2s; public class Main { /**//from w ww . ja v a 2 s . c o m * e.g: String[] result={"TYHR0001","TYHR0002"}; split=","; return: * str="TYHR0001,TYHR0002"; * * @param Object * [] * @param split * @return String */ public static String arrayToStr(Object[] arr, char split) { if (arr == null || arr.length == 0) { return null; } StringBuffer sb = new StringBuffer(); for (int i = 0; i < arr.length; i++) { if (i > 0) { sb.append(split); } sb.append(arr[i]); } return sb.toString(); } }