static bool String.IsNullOrEmpty(String stringToCheck)
Returns whether the supplied string is null or empty. This is simply shorthand for the following:
if ((stringToCheck == null) || (stringToCheck == ""))
in other words, you can easily use this to check whether a string has any text in it or not.
NOTE: This function is static, which means you do not call it on an existing
string variable, but use String.IsNullOrEmpty() instead. See the example.
Example:
String myString;
if (String.IsNullOrEmpty(myString))
{
myString = "Some text";
}
will set the myString variable to "Some text" if it is null or empty (which it is).
Compatibility: Supported by AGS 3.0.1 and later versions.
|