Speed Tip – Creating an Empty String

When setting a string object to an empty string, I did a test and I found that doing this:

string ContentFieldName = String.Empty;

Is slightly faster than doing this:

string ContentFieldName = "";

Your results my vary 

 

Tip Submitted By: David McCarter


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.