CodeX
Published in

CodeX

.NET == and .Equals() + More Ways to Compare Correctly in .NET — Definitive Guide

Because .NET behaves very strangely here

Object-oriented programming languages allow you comparisons, whatever the type. Sadly, .NET does it a bit weirdly and follows strange rules.

This doesn’t make comparisons straightforward and predictable. While the == operator acts as…

--

--

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Arnold Abraham

JavaScript, TypeScript and C#/.NET Tutorials/News/Best Practices by a German Software Engineer - Fun helps you to learn on the fly --> arnoldcode.com