Nice new StringBuilder method “AppendJoin” in .NET Core 2.0
Posted: (EET/GMT+2)
The .NET Core platform has progressed in big steps lately, and recently, I was browsing the venerable System.Text.StringBuilder class' documentation. To my surprise I found out about a new method that I haven't been using before: AppendJoin().
This StringBuilder.AppendJoin method takes two parameters: a separator character and an enumerable collection of objects. For each object it finds, it adds the object's string presentation (ToString) to the existing string, and prefixes it with the separator character, if needed.
At least for me, this is something I've done manually zillion times before with a for loop, so I'm happy to see this common need addressed as a method.
Good going, .NET Core 2!