GetString | getString method

ResourceLoader.GetString | getString method

Returns the most appropriate string value of a resource, specified by resource identifier, for the default ResourceContext of the view in which the ResourceLoader was obtained using ResourceLoader.GetForCurrentView.

Syntax


var string = resourceLoader.getString(resource);

Parameters

resource

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The resource identifier of the resource to be resolved.

Note  The resource identifier is treated as a URI fragment, subject to URI semantics. For example, getString("Caption%20") is treated as getString("Caption "). Do not use "?" or "#" in resource identifiers, as they terminate the named resource path. For example, "Foo?3" is treated as "Foo".
 

Return value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The most appropriate string value of the specified resource for the default ResourceContext.

Remarks

Example:


var string = resourceLoader.getString('Header1');

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.ApplicationModel.Resources
Windows::ApplicationModel::Resources [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.ApplicationModel.Resources
Windows::ApplicationModel::Resources [C++]

Metadata

Windows.winmd

See also

ResourceLoader
ResourceContext

 

 

Show:
© 2016 Microsoft