Encoding.Equals Method (Object)

 

Determines whether the specified Object is equal to the current instance.

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

override Equals : 
        value:Object -> bool

Parameters

value
Type: System.Object

The Object to compare with the current instance.

Return Value

Type: System.Boolean

true if value is an instance of Encoding and is equal to the current instance; otherwise, false.

Two instances of Encoding are considered equal if they correspond to the same code page and their EncoderFallback and DecoderFallback objects are equal. In particular, derived code pages all have a code page of 0 and their fallbacks are normally null (Nothing in Visual Basic .NET). Thus they are all considered equal to one another. One consequence is that when Equals is used to populate a hash table, all derived encodings compare equal and fall into the same hash table slot.

The following example gets two instances of the same encoding (one by codepage and another by name), and checks their equality.

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: