CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

IsNullOrEmpty Extending string

338 Views
Copy Code Show/Hide Line Numbers
/// <summary>
    /// Extendendo string usando o proprio isnullorempty
    /// assim fica muito mais intuitivo
    /// </summary>
    /// <param name="txt"></param>
    /// <returns></returns>
    public static bool IsNullOrEmpty(this string txt)
    {
        return String.IsNullOrEmpty(txt);
    }
 
    /// <summary>
    /// Extendendo string usando o proprio isnullorempty
    /// </summary>
    /// <param name="txt"></param>
    /// <returns></returns>
    public static bool IsNotNullOrEmpty(this string txt)
    {
        return (!String.IsNullOrEmpty(txt));
    }
by Giuliano Lemes
  July 28, 2009 @ 6:41am
Tags:
Description:
Extending string class i love do ".IsNullOrEmpty" or ".IsNotNullOrEmpty"

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate