SyntaxFix
Write A Post
Hire A Developer
Questions
🔍
[c#] Best way to remove the last character from a string built with stringbuilder
Home
Question
Best way to remove the last character from a string built with stringbuilder
I recommend, you change your loop algorithm:
Add the comma not AFTER the item, but BEFORE
Use a boolean variable, that starts with false, do suppress the first comma
Set this boolean variable to true after testing it
Examples related to
c#
•
How can I convert this one line of ActionScript to C#?
•
Microsoft Advertising SDK doesn't deliverer ads
•
How to use a global array in C#?
•
How to correctly write async method?
•
C# - insert values from file into two arrays
•
Uploading into folder in FTP?
•
Are these methods thread safe?
•
dotnet ef not found in .NET Core 3
•
HTTP Error 500.30 - ANCM In-Process Start Failure
•
Best way to "push" into C# array
Examples related to
stringbuilder
•
Best way to remove the last character from a string built with stringbuilder
•
What is the simplest way to write the contents of a StringBuilder to a text file in .NET 1.1?
•
How to append a newline to StringBuilder
•
Correct way to use StringBuilder in SQL
•
java: use StringBuilder to insert at the beginning
•
How can I clear or empty a StringBuilder?
•
Remove last character of a StringBuilder?
•
Difference between string and StringBuilder in C#
•
String, StringBuffer, and StringBuilder
•
Newline character in StringBuilder