StringComparer::Equals Method (String^, String^)
When overridden in a derived class, indicates whether two strings are equal.
Assembly: mscorlib (in mscorlib.dll)
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::Booleantrue if x and y refer to the same object, or x and y are equal, or x and y are null; otherwise, false.
Implements
IEqualityComparer<T>::Equals(T, T)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.
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