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 ...
Null pointer exceptions are no fun. You can avoid them and keep your code clean and maintainable by using these techniques to elegantly handle null values in C#. When working on applications in any ...
Take advantage of the null object pattern in .NET to eliminate the need for null checks and avoid runtime errors in your applications. You might often encounter null reference exceptions in your ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results