C# 字符串前加$

Posted lishidefengchen

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C# 字符串前加$相关的知识,希望对你有一定的参考价值。

string s = "hello";
string fo = $"s world";

// 等同于使用Format方法:
string fo = string.Format("0 world",s);

(完)

以上是关于C# 字符串前加$的主要内容,如果未能解决你的问题,请参考以下文章