Best way to break long strings in C# source code

后端 未结 10 1483
伪装坚强ぢ
伪装坚强ぢ 2021-02-03 18:47

I am wondering what is the \"best practice\" to break long strings in C# source code. Is this string

\"string1\"+
\"string2\"+
\"string3\"

con

10条回答
  •  天涯浪人
    2021-02-03 19:30

    StringBuilder will be your fastest approach if you are using any amount of strings.

    http://dotnetperls.com/Content/StringBuilder-1.aspx

    If you are just doing a few string (5 or less is a good rule) the speed will not matter of what kind of concatenation you are using.

提交回复
热议问题