StringComparer.Equals Method (Object, Object)

 
System_CAPS_noteNote

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

When overridden in a derived class, indicates whether two objects are equal.

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

abstract Equals : 
        x:Object *
        y:Object -> bool
override Equals : 
        x:Object *
        y:Object -> bool

Parameters

x
Type: System.Object

An object to compare to y.

y
Type: System.Object

An object to compare to x.

Return Value

Type: System.Boolean

true if x and y refer to the same object, or x and y are both the same type of object and those objects are equal, or both x and y are null; otherwise, false.

Because the runtime does not have to unbox x or y if they are value types or attempt to downcast x or y to strings if they are reference types, the Equals(String, String) method may be slightly more efficient than the Equals(Object, Object) method.

.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: