Console.WriteLine($"Date:{weatherForecast.Date}"); Console.WriteLine($"TemperatureCelsius:{weatherForecast.TemperatureCelsius}"); Console.WriteLine($"Summary:{weatherForecast.Summary}");
上述代码,通过$,后面使用花括号,连接,就可以嵌入进入。
原文:https://www.cnblogs.com/zhulinmails/p/14916730.html