Click here to Skip to main content
12,357,477 members (75,514 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

3.4K views
Posted

Handy Extension Methods

, 3 Jun 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
public static bool IsNullEmptyOrWhitespace(this string value){ return string.IsNullOrEmpty(value) || string.IsNullOrEmpty(value.Trim());}In C# 4.0, you already have such a function.string.IsNullOrWhiteSpace(value)
public static bool IsNullEmptyOrWhitespace(this string value)
{
        return string.IsNullOrEmpty(value) || string.IsNullOrEmpty(value.Trim());
}

In C# 4.0, you already have such a function.

string.IsNullOrWhiteSpace(value)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anshul R
Student
India India
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralCalling value.Trim creates a new copy of the string. Why not... Pin
Richard Deeming8-Jun-11 6:25
memberRichard Deeming8-Jun-11 6:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 3 Jun 2011
Article Copyright 2011 by Anshul R
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid