Helper Methods: How to Determine if a String is Empty, Null, or WhiteSpace

C# has two very under appreciated helper methods that can be used to quickly determine whether a string is null, empty, or just contains whitespace. To determine whether a string is empty (Length == 0) or null, you can use the static string helper method string.IsNullOrEmpty(). Using this helper method to determine if a string … Continue reading “Helper Methods: How to Determine if a String is Empty, Null, or WhiteSpace”

Ref Parameters vs. Out Parameters in C#

Though both ref and out parameters are used to pass arguments through a method, they aren’t used in exactly the same way. Ref keywords are used to pass an argument as a reference, meaning that when the value of that parameter changes after being passed through the method, the new value is reflected in the … Continue reading “Ref Parameters vs. Out Parameters in C#”