Equals Method (String, String)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Determines whether two specified String objects have the same value.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static bool Equals(
	string a,
	string b
)

Parameters

a
Type: System..::..String
The first string to compare, or nullNothingnullptrunita null reference (Nothing in Visual Basic).
b
Type: System..::..String
The second string to compare, or nullNothingnullptrunita null reference (Nothing in Visual Basic).

Return Value

Type: System..::..Boolean
true if the value of a is the same as the value of b; otherwise, false. If both a and b are nullNothingnullptrunita null reference (Nothing in Visual Basic), the method returns true.

This method performs an ordinal (case-sensitive and culture-insensitive) comparison.

Show: