parseJSON

fun parseJSON(jsonString: String): Any?

Parses a JSON string and returns either a JSONObject or JSONArray based on its structure.

Return

a JSONObject or JSONArray if the string can be parsed, or null if it cannot be parsed as valid JSON

Parameters

jsonString

the JSON string to parse

See also