JsonObject.GetNamedString Method
Definition
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.
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)
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
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)
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
The String with the specified name, or if this value wasn't found, the defaultValue is returned.
- Attributes