开发者社区> 问答> 正文

从Json对象中获取字符串值

在我的应用程序中,我从HTTP Response获取以下的json。[{"Date":"2012-1-4T00:00:00","keywords":null,"NeededString":"this is the sample string I am needed for my project","others":"not needed"}]我想从上面的json中获得 "NeededString" ,如何实现呢?

展开
收起
杨冬芳 2016-07-04 10:34:12 1587 0
1 条回答
写回答
取消 提交回答
  • IT从业

    String str="{"Date":"2012-1-4T00:00:00","keywords":null,"NeededString":"this is the sample string I am needed for my project","others":"not needed"}";转义不写了,说下JsonObject jobj=new JsonObject(str);String needStr=jobj.getStrig("NeededString");

    2019-07-17 19:50:31
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载