众所周知,String是不可变的.String不可变的原因是什么,StringBuilder类的引入是可变的?
例如,编译器是否知道要翻译
string s = "test " + "this " + "function";
Run Code Online (Sandbox Code Playgroud)
至
string s = "test this function";
Run Code Online (Sandbox Code Playgroud)
从而避免字符串连接的性能损失?