ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

Shorthand ReferenceEquals

This extension method represents shorthand version of ReferenceEquals method.

Source

public static new bool ReferenceEquals(this object objA, object objB) { return Object.ReferenceEquals(objA, objB); }

Example

string a = "123";
string b = a;
bool result = a.ReferenceEquals(b);
// result will true

Author: rkttu

Submitted on: 3 feb. 2016

Language: C#

Type: Object

Views: 3633