String - IsNull

A T extension method that query if the string object is null.

Try it

public static void Main()
{
	string [] values = {"EntityFramework", "    ", "SQL", "", "Java", null};

	foreach(var str in values)
	{
		// C# Extension Method: String - IsNull
    	if(!str.IsNull())
		{
			Console.WriteLine(str);
		}
	}
}

View Source
using System;

public static partial class Extensions
{
    /// <summary>
    ///     A T extension method that query if '@this' is null.
    /// </summary>
    /// <param name="this">The @this to act on.</param>
    /// <returns>true if null, false if not.</returns>
    public static bool IsNull(this String @this)
    {
        return @this == null;
    }
}