Skip to content

Commit

Permalink
used string.IsNullOrWhiteSpace for IsBlank
Browse files Browse the repository at this point in the history
  • Loading branch information
jittuu committed May 23, 2012
1 parent e405dc0 commit 1dad2b2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions NSupport/StringAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ public static bool IsNullOrEmpty(this string source) {
/// <param name="source">An instance of <see cref="string"/>.</param>
/// <returns>true if <paramref name="source"/> is null or empty or only whitespace, otherwise false.</returns>
public static bool IsBlank(this string source) {
if (string.IsNullOrEmpty(source)) {
return true;
}

var trimmedSource = source.Trim();
return (trimmedSource.Length == 0);
return string.IsNullOrWhiteSpace(source);
}
}
}

0 comments on commit 1dad2b2

Please sign in to comment.