Android JSON to String Convert pakJson(String json, String... jsons)

Here you can find the source of pakJson(String json, String... jsons)

Description

pak Json

Declaration

public static String pakJson(String json, String... jsons) 

Method Source Code

//package com.java2s;

public class Main {

    public static String pakJson(String json, String... jsons) {
        StringBuilder sBuilder = new StringBuilder();
        json = json.substring(0, json.length() - 1);
        sBuilder.append(json);/*  w  w  w.  j a  v a  2  s  . c o  m*/
        for (int i = 0; i < jsons.length; i++) {
            sBuilder.append(",");
            sBuilder.append(jsons[i].subSequence(1, jsons[i].length() - 1));
        }
        sBuilder.append("}");
        return sBuilder.toString();
    }
}

Related

  1. getJsonErrorMsg(JSONObject errorResponse)
  2. getStringArray(JSONArray jsonArray)