Is object Null Or Empty - CSharp System

CSharp examples for System:Object

Description

Is object Null Or Empty

Demo Code


using System.Text.RegularExpressions;
using System.Collections;
using System;/*from  w  ww  .ja  v  a  2 s .  co  m*/

public class Main{
    public static bool IsNullOrEmpty(this object value)
      {
         if (value is string)
            return string.IsNullOrEmpty(value as string);
         return value == null;
      }
}

Related Tutorials