spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * String functions

IsNullOrEmpty

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.


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.