ExtensionMethod.NET Home of 840 C#, Visual Basic, F# and Javascript extension methods


Returns true when a given string is not null or empty


public static bool IsNotNullOrEmpty(this string input) {
    return !String.IsNullOrEmpty(input);


string a = "demo";
string b = string.Empty;
string c = null;

Console.WriteLine(a.IsNotNullOrEmpty()); // true
Console.WriteLine(b.IsNotNullOrEmpty()); // false
Console.WriteLine(c.IsNotNullOrEmpty()); // false

Author: unknown

Submitted on: 29 feb 2008

Language: C#

Type: System.String

Views: 6574