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)
Syntax
'Declaration
Public Shared Function Equals ( _
a As String, _
b As String _
) As Boolean
public static bool Equals(
string a,
string b
)
public:
static bool Equals(
String^ a,
String^ b
)
static member Equals :
a:string *
b:string -> bool
public static function Equals(
a : String,
b : String
) : boolean
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.
Remarks
This method performs an ordinal (case-sensitive and culture-insensitive) comparison.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.