Uri.ToString | toString method

Gets a canonical string representation for the current Uri.

Syntax


var string = uri.toString();

Parameters

This method has no parameters.

Return value

Type: String [JavaScript] | Platform::String [C++]

The unescaped canonical representation of the current Uri. All characters are unescaped, except #, ?, and %.

Remarks

This ToString implementation is for the IStringable interface as implemented by the Uri class. IStringable is supported starting with Windows 8.1 and is also available in Windows Phone 8.1. The IStringable definition of ToString implementation is not literally an override of Platform::Object and its base API, but it does replace the ToString behavior.

For Windows 8 and Windows Phone 8, Uri does not implement IStringable (it's not available). So the ToString method of Uri remains the one that's implemented by Platform::Object or JavaScript "object" support for Windows Runtime. The apparent difference in origin of the ToString API is only visible for Visual C++ component extensions (C++/CX) and JavaScript, and you should consider it as an implementation detail that doesn't matter as far as how you use ToString in either case.

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Foundation
Windows::Foundation [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

None supported

Namespace

Windows.Foundation
Windows::Foundation [C++]

Metadata

Windows.winmd

See also

Uri

 

 

Show:
© 2015 Microsoft