Sunday, January 08, 2006

Fast If Empty

The fastest way to check to see if a string is empty is to check it's length. Any other method like comparing it to an empty string (or "") is about three times slower and generates another memory address to do the comparison with.
If i.Length = 0 Then