Today just quick tip about StringBuilder
I used to remove last character(s) from StringBuilder using Remove method.
1 2 |
StringBuilder builder = new StringBuilder("some long text with comma,"); builder.Remove(builder.Length - 1, 1); |
However, recently I’ve came accross even simpler solution. You just need to lessen the Length property of StringBuilder, in order to get rid of last characters
1 2 |
StringBuilder builder = new StringBuilder("some long text with comma,"); builder.Length--; |