String.Equals Method (String, String)

 

Determines whether two specified String objects have the same value.

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

static member Equals : 
        a:string *
        b:string -> bool

Parameters

a
Type: System.String

The first string to compare, or null.

b
Type: System.String

The second string to compare, or null.

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 null, the method returns true.

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

The following example demonstrates the Equals method.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: