getStringOrNull

fun JSONObject.getStringOrNull(key: String): String?

Returns the value mapped by the specified key as a String, or null if the key is not present.

Return

The associated value as a String, or null if the key is not found.

Parameters

key

The key whose associated value is to be fetched.