Condividi tramite


JsonObject.Remove Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Removes the key/value pair with a specified key from the JSON CLR object type.

Namespace:  System.Json
Assembly:  System.Json (in System.Json.dll)

Syntax

'Declaration
Public Function Remove ( _
    key As String _
) As Boolean
public bool Remove(
    string key
)

Parameters

Return Value

Type: System.Boolean
true if the element is successfully found and removed; otherwise, false. This method returns false if key is not found in the JSON CLR object.

Implements

IDictionary<TKey, TValue>.Remove(TKey)

Exceptions

Exception Condition
ArgumentNullException

key is nulla null reference (Nothing in Visual Basic).

Remarks

If the JsonObject does not contain an element with the specified key, the JsonObject remains unchanged. No exception is thrown.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.