hashmap to json
来源:互联网 发布:德国哪个公司办网络好 编辑:程序博客网 时间:2024/06/08 15:44
public class HashmapToJson { public static String hashMapToJson(HashMap<String, String> map) { String string = "{"; for (Iterator<Entry<String, String>> it = map.entrySet().iterator(); it.hasNext();) { Entry<String, String> e = (Entry<String, String>) it.next(); string += "\"" + e.getKey() + "\":"; string += "\"" + e.getValue() + "\","; } string = string.substring(0, string.lastIndexOf(",")); string += "}"; return string; } public static void main(String[] args) { HashMap<String, String> map = new HashMap<>(); map.put("access_token", "addd"); map.put("name", "Tom"); System.out.println(hashMapToJson(map)); }
阅读全文
0 0
- hashmap to json
- 关联json与hashmap
- JSON(对象数组,HashMap)
- How to sort HashMap ??
- JsonObject To HashMap
- HashMap how to work
- 把hashMap转换成json
- HashMap转换成Json格式
- hashmap转换成json格式
- 遍历JSON字符串转为HashMap
- HashMap转换成json实例
- Linq to JSON/Json.NET
- js string to json / json to string
- JSON to MAP,MAP to JSON
- json to js OR js to json
- dict to json And json to dict
- json to bean 和 bean to json
- android解析json数据20150214(HashMap)
- 记录负数个数平均正数值
- 母函数博客整理
- ThinkPHP总结三
- linux设备驱动模型之总线、设备、驱动三者的关系
- oracle多表查询
- hashmap to json
- linux学习笔记-day2
- 进程和线程
- java之继承
- ThinkPHP框架总结五
- python类的定义与对象的创建及书写规范
- ionic框架的学习(入门篇)
- python作业7.8
- 还原网站上压缩的js代码