我有一个字符串 "{"result": "27"}"
如何从 java 中的上述字符串中检索 27 的值?
您的帮助将不胜感激,谢谢!
最佳答案
试试这个..
String string_type = "{\"result\" : \"27\"}";
JSONObject string_value = new JSONObject(string_type);
String result = string_value.getString("result");
Syatem.out.println("result :"+result);
关于java - 如何从字符串类型的键值对中获取值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23844055/