3 ms·
C#'s new interpolation syntax is a counterexample to your point about easy formatting: https://msdn.microsoft.com/en-us/library/dn961160.aspx#Anchor_1 https://
by drjeats 10y ago
C#'s new interpolation syntax is a counterexample to your point about easy formatting:
https://msdn.microsoft.com/en-us/library/dn961160.aspx#Anchor_1 https://msdn.microsoft.com/en-us/library/dn961160.aspx#Ancho...
$"Name = {name}, hours = {hours:hh}"
var s = $"hello, {name}"
System.IFormattable s = $"Hello, {name}"
System.FormattableString s = $"Hello, {name}"
$"{person.Name, 20} is {person.Age:D3} year {(p.Age == 1 ? "" : "s")} old."