public static String formatArray(String[] arr, char sep) {
	    if (arr.length == 0)
	      return "";
	    StringBuffer sb = new StringBuffer();
	    int sepcount = arr.length - 1;
	    for (int i = 0; i < sepcount; i++)
	      sb.append(arr[i] + sep);
	    sb.append(arr[sepcount]);
	    return sb.toString();
	  }