Best way to remove the last character from a string built with stringbuilder

后端 未结 12 2408
-上瘾入骨i
-上瘾入骨i 2020-12-23 14:30

I have the following

data.AppendFormat(\"{0},\",dataToAppend);

The problem with this is that I am using it in a loop and there will be a t

12条回答
  •  误落风尘
    2020-12-23 14:49

    You have two options. First one is very easy use Remove method it is quite effective. Second way is to use ToString with start index and end index (MSDN documentation)

提交回复
热议问题