this is from code in a web form. I added several times to my StringBuilder and accidentally made
return "[" + sbFinalContents + "]";
and I had no problems with that. I accidentally left the ToString () part, and I didn’t even notice for several days. any idea why this is not exploding?
StringBuilder.ToString Method (.net 4.): "You must call the ToString method to convert the StringBuilder object to a String object before passing the string represented by the StringBuilder object to the String method or displaying it in the user interface. "
technically, I don't do a single one (I just return the string), but I'm still surprised that it did not fail.
source share