Recipe 3.2. Allowing a Type to Represent Itself as a String
Problem
Your class or structure needs to control how its information is displayed when its ToString method is called. In addition, you need to apply different formats to this information. For example, when creating a new data type, such as a Line class, you might want to allow objects of this type to be able to display themselves in a textual format. In the case of a Line object, it might display itself as (x1, y1)(x2, y2).
Solution
Override and/or implement the IFormattable.ToString method to display numeric information, such as for a Line structure: