Click here to Skip to main content
15,886,063 members
Articles / Programming Languages / C#

A ToString replacement that recognizes different data types

27 Oct 2021CPOL1 min read 5.5K   4  
Most data types have a built-in ToString method, but not all, and what's more, the default method can throw an error if, for example, the object is null.
This is an old version of the currently published tip/trick.

Only logged in members can view this content

Please go to the C# Table of Contents to view the list of available articles in this section.