Answers for "json object check if key exists java"

0

json object check if key exists java

// JSONObject class has a method named "has":
// http://developer.android.com/reference/org/json/JSONObject.html#has(java.lang.String)
// Returns true if this object has a mapping for name. The mapping may be NULL.
if (json.has("status")) {
   String status = json.getString("status"));
}

if (json.has("club")) {
   String club = json.getString("club"));
}
Posted by: Guest on March-05-2020

Code answers related to "json object check if key exists java"

Code answers related to "Javascript"

Browse Popular Code Answers by Language