-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #534 from Shane32/refactor_ext_methods
Refactor compatibility extension methods
- Loading branch information
Showing
5 changed files
with
43 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace QRCoder | ||
{ | ||
internal static class StringExtensions | ||
{ | ||
/// <summary> | ||
/// Indicates whether the specified string is null, empty, or consists only of white-space characters. | ||
/// </summary> | ||
/// <returns> | ||
/// <see langword="true"/> if the <paramref name="value"/> is null, empty, or white space; otherwise, <see langword="false"/>. | ||
/// </returns> | ||
public static bool IsNullOrWhiteSpace(this string value) | ||
{ | ||
#if NET35 | ||
if (value == null) return true; | ||
|
||
for (int i = 0; i < value.Length; i++) | ||
{ | ||
if (!char.IsWhiteSpace(value[i])) return false; | ||
} | ||
|
||
return true; | ||
#else | ||
return string.IsNullOrWhiteSpace(value); | ||
#endif | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters