在字符串前加$相当于对string.format()的简化
string name = "张三";

string add = "河南郑州";

Console.WriteLine("你好我是{0},我来自{1}", name, add);

Console.WriteLine($"你好我是{name},我来自{add}");

Console.ReadKey();

 

相关文章:

  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-02-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
  • 2021-07-31
  • 2022-01-06
相关资源
相似解决方案