JsonValue.Parse Method

Parses the specified JSON string into a JSON value.

Syntax

public:
static JsonValue^ Parse(
         String^ input
)  

Parameters

input
Type: String 

  The specified JSON string.

Return value

Type: JsonValue 

A new JsonValue that is based on the parsed string.

Remarks

This method may only be called when the ValueType is Null. If the value contained in the specified JSON string is a String, a Number or a Boolean, the ValueType will be updated and the actual value can then be accessed through the GetString, GetNumber, or GetBoolean methods. If Parse fails due to an invalid JSON string or resource allocation errors, the ValueType will not be changed.

When implemented on the subclass JsonObject, this method requires the specified input string to be a valid JSON object value. When implemented on the subclass JsonArray, this method requires the specified input string to be a valid JSON array value. The original object state will be overwritten when JsonObject.Parse or JsonArray.Parse succeeds. If Parse fails, the object state remains intact.

Requirements

Namespace: Windows.Data.Json

Metadata: windows.winmd

See also

Reference

JsonValue Class

JsonValue Members

Windows.Data.Json Namespace