Make a string from the contents of this JSONArray. The separator string is inserted between each element. Warning: This method assumes that the data structure is acyclical. @param separator A string that will be inserted between the elements. @return a string. @throws JSONException If t
(String separator)
| 350 | * @throws JSONException If the array contains an invalid number. |
| 351 | */ |
| 352 | public String join(String separator) throws JSONException { |
| 353 | int len = length(); |
| 354 | StringBuffer sb = new StringBuffer(); |
| 355 | |
| 356 | for (int i = 0; i < len; i += 1) { |
| 357 | if (i > 0) { |
| 358 | sb.append(separator); |
| 359 | } |
| 360 | sb.append(JSONObject.valueToString(this.myArrayList.get(i))); |
| 361 | } |
| 362 | return sb.toString(); |
| 363 | } |
| 364 | |
| 365 | |
| 366 | /** |