/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/============================== Check for empty string string s = "hello"; // Test if a string is neither null nor empty. This has to be a static // memeber of the String class because the object may be null! if ( !String.IsNullOrEmpty( s ) ) ... // Test if a string is empty. if ( s.Length != 0 ) ... // Test if a string is empty. (another way, more explicit way to do it) if ( s != String.Empty ) ...