使用字符串插值之间是否存在显着的性能差异:
myString += $"{x:x2}";
Run Code Online (Sandbox Code Playgroud)
vs String.Format()?
myString += String.Format("{0:x2}", x);
Run Code Online (Sandbox Code Playgroud)
我只是问,因为Resharper正在提示修复,我之前被愚弄了.
例如,编译器是否知道要翻译
string s = "test " + "this " + "function";
Run Code Online (Sandbox Code Playgroud)
至
string s = "test this function";
Run Code Online (Sandbox Code Playgroud)
从而避免字符串连接的性能损失?