Language: C#
IsNullOrWhiteSpace with some LINQ love
/// <summary> /// Determine if the specified string is blank, where blank is defined /// as null, empty or containing only whitespace characters. /// </summary> /// <param name="value">string to be evaluated</param> /// <returns> /// true if the value is null, empty or contains only /// whitespace characters; otherwise false /// </returns> static bool IsNullOrWhiteSpace(string value) { if (string.IsNullOrEmpty(value)) return true; return !value.Any(c => !char.IsWhiteSpace(c)); }
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

