Tag Archives: extension method

stringObject.IsNullOrWhiteSpace() a simple c# extension method

Every time doing String.IsNullOrWhiteSpace(input) is irritating. Moreover we try to input. and look for this method in intelligence. But it won’t be there, as it is static, unless we do String. we don’t see this method.

Writing an extension method will save us this trouble.

public static class MustHaveCSharpExtensions
{
	public static bool IsNullOrWhiteSpace(this string input)
	{
		return String.IsNullOrWhiteSpace(input);
	}
}