How should I concatenate strings?

前端 未结 9 1450
不知归路
不知归路 2020-12-06 00:43

Are there differences between these examples? Which should I use in which case?

var str1 = \"abc\" + dynamicString + dynamicString2;

var str2 = String.Form         


        
9条回答
  •  余生分开走
    2020-12-06 01:23

    @ Jerod Houghtelling Answer

    Actually String.Format uses a StringBuilder behind the scenes (use reflecton on String.Format if you want)

    I agree with the following answer in general

提交回复
热议问题