Udostępnij za pośrednictwem


LanguagePrimitives.Equals Method

Definition

Overloads

Equals(Object, Object)

Used to compare two objects for equality converting the second to the type of the first, if required.

Equals(Object, Object, Boolean)

Used to compare two objects for equality converting the second to the type of the first, if required.

Equals(Object, Object, Boolean, IFormatProvider)

Used to compare two objects for equality converting the second to the type of the first, if required.

Equals(Object, Object)

Used to compare two objects for equality converting the second to the type of the first, if required.

public:
 static bool Equals(System::Object ^ first, System::Object ^ second);
public:
 static bool Equals(Platform::Object ^ first, Platform::Object ^ second);
 static bool Equals(winrt::Windows::Foundation::IInspectable const & first, winrt::Windows::Foundation::IInspectable const & second);
public static bool Equals (object first, object second);
static member Equals : obj * obj -> bool
Public Shared Function Equals (first As Object, second As Object) As Boolean

Parameters

first
Object

First object.

second
Object

Object to compare first to.

Returns

True if first is equal to the second.

Applies to

Equals(Object, Object, Boolean)

Used to compare two objects for equality converting the second to the type of the first, if required.

public:
 static bool Equals(System::Object ^ first, System::Object ^ second, bool ignoreCase);
public:
 static bool Equals(Platform::Object ^ first, Platform::Object ^ second, bool ignoreCase);
 static bool Equals(winrt::Windows::Foundation::IInspectable const & first, winrt::Windows::Foundation::IInspectable const & second, bool ignoreCase);
public static bool Equals (object first, object second, bool ignoreCase);
static member Equals : obj * obj * bool -> bool
Public Shared Function Equals (first As Object, second As Object, ignoreCase As Boolean) As Boolean

Parameters

first
Object

First object.

second
Object

Object to compare first to.

ignoreCase
Boolean

used only if first and second are strings to specify the type of string comparison

Returns

True if first is equal to the second.

Applies to

Equals(Object, Object, Boolean, IFormatProvider)

Used to compare two objects for equality converting the second to the type of the first, if required.

public:
 static bool Equals(System::Object ^ first, System::Object ^ second, bool ignoreCase, IFormatProvider ^ formatProvider);
public static bool Equals (object first, object second, bool ignoreCase, IFormatProvider formatProvider);
static member Equals : obj * obj * bool * IFormatProvider -> bool
Public Shared Function Equals (first As Object, second As Object, ignoreCase As Boolean, formatProvider As IFormatProvider) As Boolean

Parameters

first
Object

First object.

second
Object

Object to compare first to.

ignoreCase
Boolean

used only if first and second are strings to specify the type of string comparison

formatProvider
IFormatProvider

the format/culture to be used. If this parameter is null, CultureInfo.InvariantCulture will be used.

Returns

True if first is equal to the second.

Applies to