System.String.Equals Method

Determines whether two specified string objects have the same value. A parameter specifies the culture, case, and sort rules used in the comparison.

Syntax

public static bool Equals (string a, string b, StringComparison comparisonType)

Parameters

a
The first string to compare, or null.
b
The second string to compare, or null.
comparisonType
One of the enumeration values that specifies the rules for the comparison.

Returns

true if the value of the a parameter is equal to the value of the b parameter; otherwise, false.

Remarks

The comparisonType parameter indicates whether the comparison should use the current or invariant culture, honor or ignore the case of the two strings being compared, or use word or ordinal sort rules.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0