Did you ever wonder how we can iterate through a StringBuilder
? I mean, of course, we can just call ToString
and use the returned string, but that means we materialize the whole thing without good reason.
We can also use a normal for-loop. But we can also find a completely different and probably dumber way! And if you wonder: No, this is not something you do in your daily life, but by doing that thing, I can show some cool stuff C# and .NET offer.
Found here