What is the different between stringvariable != NullValue.String and !string.IsNullOrEmpty(stringvariable) in asp.net? -


is there different between stringvariable != nullvalue.string , !string.isnullorempty(stringvariable) in asp.net ? best ?

the first tests string isn't "".

as strings can null (because references) test fail.

by using isnullorempty wrapping:

if (string != null && string.length > 0) 

in 1 test.


Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -