StringComparer.Equals Method (String, String)

 

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

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

public abstract bool Equals(
	string x,
	string y
)

Parameters

x
Type: System.String

A string to compare to y.

y
Type: System.String

A string to compare to x.

Return Value

Type: System.Boolean

true if x and y refer to the same object, or x and y are equal, or 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.

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