System.String.Equals Method

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

Syntax

public bool Equals (string value, StringComparison comparisonType)

Parameters

value
The string to compare to this instance.
comparisonType
One of the enumeration values that specifies how the strings will be compared.

Returns

true if the value of the value parameter is the same as this string; 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