I was just dealing with strings, and I find myself annoyed that strings can be nullable. So, I have to have
if((teststring??string.Empty)==string.Empty)
all over the place. Would string? have been so hard for allowing nullability in the relatively few cases where it is needed (dbs, idiot user inputs, etc.). I also find myself irritated with having to export readonly interfaces in the cases where I want some form of const correctness. So, what C# language construct/decision annoys you?
EDIT: Thanks for the isnullorempty function, I hadn't seen that before! Still doesn't lessen my annoyance at it being nullable :D
Testing strings for Null or Empty is best done using:
if (string.IsNullOrEmpty(testString))
{
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With