Easier way of writing null or empty?

Yes, there’s the String.IsNullOrEmpty helper method for exactly this already:

if (String.IsNullOrEmpty(myString)) {
    ...
}

Leave a Comment