How does the c# compiler concat strings

Possible Duplicate:
Does C# optimize the concatenation of string literals?

string foo = "bar1" + "bar2" + "bar3";

Does the c# compiler internally apply the string.Concat method ?

Then it would be better to use the + operator for the readability sake.


With literals, this is equivalent to:

string foo = "bar1bar2bar3";

No concatenation is performed- they are combined at compile time into a constant.

链接地址: http://www.djcxy.com/p/10346.html

上一篇: 在Spring 3.1中配置JDO?

下一篇: c#编译器如何连接字符串