1.string.Format()占位符的替换
使用$"{*}"和string.Format("{0}",*)的效果完全一样。
static void Main(string[] args) { string name = "dp"; int age = 24; string console = $"Hello,{name},Your Age Is {age}"; string console1 = string.Format("Hello,{0},Your Age Is {1}", name, age); Console.WriteLine(console); Console.WriteLine(console); Console.Read(); }