JSONArray.ToJSONObject(JSONArray) Method

Definition

Returns a new object whose values are the values in this array, and whose names are the values in names.

[Android.Runtime.Register("toJSONObject", "(Lorg/json/JSONArray;)Lorg/json/JSONObject;", "GetToJSONObject_Lorg_json_JSONArray_Handler")]
public virtual Org.Json.JSONObject? ToJSONObject (Org.Json.JSONArray? names);
[<Android.Runtime.Register("toJSONObject", "(Lorg/json/JSONArray;)Lorg/json/JSONObject;", "GetToJSONObject_Lorg_json_JSONArray_Handler")>]
abstract member ToJSONObject : Org.Json.JSONArray -> Org.Json.JSONObject
override this.ToJSONObject : Org.Json.JSONArray -> Org.Json.JSONObject

Parameters

names
JSONArray

Returns

Attributes

Exceptions

Remarks

Returns a new object whose values are the values in this array, and whose names are the values in names. Names and values are paired up by index from 0 through to the shorter array's length. Names that are not strings will be coerced to strings. This method returns null if either array is empty.

Java documentation for org.json.JSONArray.toJSONObject(org.json.JSONArray).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to