I often find myself using this great C# function: string.IsNullOrEmpty. It is the assured way to confirm whether a string is empty - null or otherwise.
However, I often find myself wanting to know when it is not empty. Thus I have to write an if statement that reads more like this:


if (!string.IsNullOrEmpty(myString)) {

// Do something

}


I personally do not find this very readable because of the ! at the start of the if statement.
Enter this little handy tidbit of code - a string extension - to improve readability: