There are various approaches you can do to this,
personally I would go with one of the following:
If the .Net framework version you are using is less than version 4
else go with:
The latter approach does not require you to trim the string first as it will detect if the string is just whitespace characters such as space, carriage returns etc.