.NET Framework 4 introduces a new method on its String class called IsNullOrWhiteSpace that checks whether a provided String is null, empty, or consists only of “white space.” This handy method is in ...
Take advantage of nullable types to assign 'no values' or 'null values' to value types when there is no value available The C# language provides support for two types of data: value types and ...
In Visual Basic I'd write this: If stringVariable IsNot Nothing then Dim x as Integer x = stringVariable.Length End If I test the string for null/nothing because if I try to get the Length of a ...