Uri.ToString | toString method

Applies to Windows only

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

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

For Windows Phone, 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

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:
© 2014 Microsoft