System.String.op_Equality Method

Determines whether two specified strings have the same value.

Syntax

public static bool operator== (string a, string b)

See Also

string.Equals(object)

Parameters

a
The first string to compare, or null.
b
The second string to compare, or null.

Returns

true if the value of a is the same as the value of b; otherwise, false.

Remarks

The string.op_Equality(string, string) method defines the operation of the equality operator for the string class. The operator, in turn, calls the static string.Equals(string, string) method, which performs an ordinal (case-sensitive and culture-insensitive) comparison.

Note:

The Visual Basic compiler does not resolve the equality operator as a call to the string.op_Equality(string, string) method. Instead, the equality operator wraps a call to the Microsoft.VisualBasic.CompilerServices.Operators.CompareString(string, string, bool) method.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0