Why does one use not null and not empty when checking for session variables? Why not just use not empty? I am looking at this page and came up with this question.
http://www.dotnetfunda.com/forums/show/8994/create-login-session
Why does one use not null and not empty when checking for session variables? Why not just use not empty? I am looking at this page and came up with this question.
http://www.dotnetfunda.com/forums/show/8994/create-login-session
String.Empty and "" are almost the same, both refer to an existing string that has no content.
Said almost because, "" creates a temporary string in memory (to have something to compare against) while String.Empty is a language constant.
On the other hand, null means nothing, no object at all.
In more familiar terms, String.Empty is like having an empty drawer while null means no drawer at all!
more information : http://social.msdn.microsoft.com/Forums/vstudio/en-US/0e7c2041-ee72-4c54-a9f5-f1617e88325a/what-is-the-difference-between-1-null-2empty-and-3-in-c?forum=csharpgeneral