Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Equals Method (Object, Object)
Collapse the table of content
Expand the table of content

StringComparer.Equals Method (Object, Object)

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

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

public bool Equals(
	Object x,
	Object y
)

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.

Implements

IEqualityComparer.Equals(Object, Object)

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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Show:
© 2015 Microsoft