文章目录
- 1.内插表达式的字段宽度和对齐方式
1.内插表达式的字段宽度和对齐方式
static void Main(string[] args) {
var titles = new Dictionary<string, string>() {
["Doyle ,Arthur"] = "Hound of the Basker,The",
["Lodon ,Jack"] = "Call of the Wild ,The",
["Shakesepeare ,William"] = "Tempest,The",
};
Console.WriteLine("Author and title List");
Console.WriteLine();
Console.WriteLine($"|{"Author",-25}|{"Title",30}|");
foreach (var title in titles) {
Console.WriteLine($"|{title.Key,-25}|{title.Value,30}|");
}
}