StackOverflow 文件 C# Language 教程 字串插值 字串插值 Created: November-22, 2018 字串插值是 string.Format() 方法的簡寫,可以更容易地構建具有變數和表示式值的字串。 placeholderCopyvar name = "World"; var oldWay = string.Format("Hello, {0}!", name); // returns "Hello, World" var newWay = $"Hello, {name}!"; // returns "Hello, World" 以字串格式化日期