Closed
Description
Background and motivation
IPAddress already provides TryFormat/TryParse methods. It should implement the appropriate interfaces to go along with these. Doing that for IPAddress
, for example, means the IPAddress
's TryFormat
will be used as part of string interpolation rather than its ToString()
being used.
API Proposal
namespace System.Net
public class IPAddress
+ : ISpanFormattable, ISpanParsable<IPAddress>
{
// all of the interface members implemented explicitly
}
API Usage
IPAddress address = ...;
string s = $"The address is {address}";
Alternative Designs
No response
Risks
No response