Java tutorial
//package com.java2s; import org.json.JSONArray; public class Main { public static String combine(JSONArray[] s, String glue) { int k = s.length; if (k == 0) return null; StringBuilder out = new StringBuilder(); out.append(s[0]); for (int x = 1; x < k; ++x) out.append(glue).append(s[x]); return out.toString(); } }