Click here to Skip to main content
15,881,882 members
Articles / General Programming / String

.NET 4: string.IsNullOrWhitespace()

Rate me:
Please Sign up or sign in to vote.
3.33/5 (2 votes)
12 Aug 2010CPOL 15.6K   1  
public static class StringExtensions { public static bool IsNullOrWhitespace(this string s) { if (null == s) return true; return string.IsNullOrEmpty(s.Trim()); } }

Views

Daily Counts

License

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


Written By
Software Developer (Senior)
United States United States
Livin in a lonely world, caught the midnight train going anywhere... Only thing is it was a runaway train... and it ain't ever goin back...
мала ка на хари, Trahentes ex exsilium

Comments and Discussions