json数据格式
来源:互联网 发布:爱心软件p图软件 编辑:程序博客网 时间:2024/06/05 06:26
给大家分享下 json数据格式化的函数,参数uglyJSONString为:json字符串
public String jsonFormatter(String uglyJSONString) {Gson gson = new GsonBuilder().setPrettyPrinting().create();JsonParser jp = new JsonParser();JsonElement je = jp.parse(uglyJSONString);String prettyJsonString = gson.toJson(je);return prettyJsonString;}
希望对大家有所帮助,也欢迎大家提出意见和提供更好的方法,学习至上!
- json数据格式
- Json数据格式
- json数据格式
- JSON数据格式
- JSON数据格式
- JSON数据格式
- JSON数据格式
- JSON数据格式
- JSON数据格式
- Json 数据格式
- JSON数据格式
- JSON 数据格式
- Json数据格式
- JSON数据格式
- json数据格式
- JSON 数据格式
- JSON 数据格式
- JSON 数据格式
- C++ List(#include<list>)
- 一些effective java的笔记
- english book1 unit1
- Android 下拉框并添加事件
- Android 性能分析案例
- json数据格式
- .\Obj\Templet.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.
- ios开发关于CoreData的一些详细介绍
- android 中文 api (64) —— Scroller
- iOS网络编程-MBProgressHUD等待指示器
- 2013年4月_武科大程序设计大赛(复赛)_解题报告(problem 1001)
- java 虚拟机--新生代与老年代GC
- 查看当前目录下有多少文件
- POJ3253《Fence Repair》方法:优先队列