Equals Method (Object)
Collapse the table of content
Expand the table of content

Char.Equals Method (Object)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Returns a value indicating whether this instance is equal to a specified object.

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

Public Overrides Function Equals ( _
	obj As Object _
) As Boolean


Type: System.Object
An object to compare with this instance or Nothing.

Return Value

Type: System.Boolean
true if obj is an instance of Char and equals the value of this instance; otherwise, false.

The comparison performed by this method is based on the encoded values of this instance and obj, not necessarily their lexicographical characteristics.

The following example demonstrates Equals.

Module Example

   Public Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)

      Dim chA As Char
      chA = "A"c
      Dim chB As Char
      chB = "B"c

      outputBlock.Text &= chA.Equals("A"c) & vbCrLf     ' Output: "True"
      outputBlock.Text &= "b"c.Equals(chB) & vbCrLf     ' Output: "False"

   End Sub

End Module

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft