Share via


JsonObject.GetNamedString Method

Definition

Overloads

GetNamedString(String)

Gets the String value with the specified name.

GetNamedString(String, String)

Gets the String value with the specified name, or the provided default value if no such named value is found.

GetNamedString(String)

Gets the String value with the specified name.

public:
 virtual Platform::String ^ GetNamedString(Platform::String ^ name) = GetNamedString;
winrt::hstring GetNamedString(winrt::hstring const& name);
public string GetNamedString(string name);
function getNamedString(name)
Public Function GetNamedString (name As String) As String

Parameters

name
String

Platform::String

winrt::hstring

The name.

Returns

String

Platform::String

winrt::hstring

The String value with the specified name.

Remarks

This method should always used with a try/catch block because it throws an exception if the name found is not a String type or the name is not found.

See also

Applies to

GetNamedString(String, String)

Gets the String value with the specified name, or the provided default value if no such named value is found.

public:
 virtual Platform::String ^ GetNamedString(Platform::String ^ name, Platform::String ^ defaultValue) = GetNamedString;
/// [Windows.Foundation.Metadata.Overload("GetNamedStringOrDefault")]
winrt::hstring GetNamedString(winrt::hstring const& name, winrt::hstring const& defaultValue);
[Windows.Foundation.Metadata.Overload("GetNamedStringOrDefault")]
public string GetNamedString(string name, string defaultValue);
function getNamedString(name, defaultValue)
Public Function GetNamedString (name As String, defaultValue As String) As String

Parameters

name
String

Platform::String

winrt::hstring

The name.

defaultValue
String

Platform::String

winrt::hstring

The default value to use if the JSON property is not found.

Returns

String

Platform::String

winrt::hstring

The String with the specified name, or if this value wasn't found, the defaultValue is returned.

Attributes

See also

Applies to