StringComparer::Equals Method (Object^, Object^)


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

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

virtual bool Equals(
	Object^ x,
	Object^ y
) sealed


Type: System::Object^

An object to compare to 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
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top