加了$能直接取{}里面的值,如果没有加,则会显示{this.mainReceiver}这类值。
例子:
不加$:要显示m_a,m_b
Console.WriteLine("this is a:{0},this is b:{1}",m_a,m_b));

加$:可将值直接放{}里:
Console.WriteLine($"this is a:{m_a} ,this is b:{m_b}");

相关文章:

  • 2021-06-21
  • 2021-08-02
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
猜你喜欢
  • 2021-06-15
  • 2021-11-06
  • 2022-12-23
  • 2021-09-03
  • 2022-01-30
相关资源
相似解决方案