Return Value
A string that represents the current object.
Interval<int> interval = new Interval<int>(-15, 23); Interval<int> notreallyInterval = new Interval<int>(6, 6); Console.WriteLine($"Interval1: {interval.ToString()}"); Console.WriteLine($"Interval2: {notreallyInterval.ToString()}"); // Results: // "Interval1: -15 ~ 23" // "Interval2: 6"