Uri.Equality Operator (Uri, Uri)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Determines whether two Uri instances have the same value.

Namespace:   System
Assembly:  System (in System.dll)

static let inline (=)
        uri1:Uri *
        uri2:Uri : bool


Type: System.Uri

A Uri instance to compare with uri2.

Type: System.Uri

A Uri instance to compare with uri1.

Return Value

Type: System.Boolean

A Boolean value that is true if the Uri instances are equivalent; otherwise, false.

This overload uses the Equals method to determine whether the two Uri instances are equivalent. UserInfo and Fragment content is ignored when making this comparison.

This example creates three Uri instances from strings and compares them to determine whether they represent the same value. Address1 and Address2 are the same because the Fragment portion is ignored for this comparison. The outcome is written to the console.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top