Is this:
foreach(Type item in myCollection) { StringBuilder sb = new StringBuilder(); }
much slower than:
StringBuilder sb = new StringBuilder(); foreach(Type item in myCollection) { sb = new StringBuilder(); }
In other words, will it really matter where I declare my StringBuilder?
StringBuilder
In the 2nd example you're creating an extra instance of StringBuilder. Apart from that they are both they same, so the performance issue is negligable.