JsonObject.Parse(String) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Parses the specified JSON string that represents a JsonObject into a JSON value.
Note
This will throw an exception if the provided JSON string is not valid. Use of JsonObject.TryParse is a recommended alternative. A TryParse call will return a boolean value to indicate success or failure and, if successful, the resultant JsonObject.
public:
static JsonObject ^ Parse(Platform::String ^ input);
static JsonObject Parse(winrt::hstring const& input);
public static JsonObject Parse(string input);
function parse(input)
Public Shared Function Parse (input As String) As JsonObject
- input
-
String
Platform::String
winrt::hstring
The specified JSON string.
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.
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |