Export (0) Print
Expand All

StringComparer::Equals Method (String, String)

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

Namespace:  System
Assemblies:   System.Runtime.Extensions (in System.Runtime.Extensions.dll)
  mscorlib (in mscorlib.dll)

public:
virtual bool Equals(
	String^ x, 
	String^ y
) abstract

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 nullptr; 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.

.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

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

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