.net 和java JSON 模板

1、.net 中JSON对象格式模板

//  JSON键值对格式:'key':'value'
 

public static string FORMAT_KEYVALUE = "\"{0}\":\"{1}\"";
//  JSON键值对格式:'key':'value'

public static string FORMAT_KEYVALUE2 = "\"{0}\":{1}";
//  JSON对象格式:{content}

public static string FORMAT_JSONOBJECT = "{{{0}}}";
// JSON数组格式:[items]
public static string FORMAT_JSONARRARY = "[{0}]";


2、Java 中JSON对象格式模板

 //  JSON键值对格式:'key':'value'
public  static final  String FORMAT_KEYVALUE = "\"%s\":\"%s\"";
//  JSON键值对格式:'key':'value'
public  static final  String FORMAT_KEYVALUE2 = "\"%s\":%s"; 
//  JSON对象格式:{content}
public  static final  String FORMAT_JSONOBJECT = "{%s}"; 

// JSON数组格式:[items]
public  static final  String FORMAT_JSONARRARY = "[%s]";

 

posted @ 2015-03-10 12:26  德玛西亚冲锋  阅读(413)  评论(0编辑  收藏  举报