Created
December 25, 2020 18:47
-
-
Save The-Running-Dev/823b52f1f1c647990c5ef75b9d52710a to your computer and use it in GitHub Desktop.
String Extensions
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
/// <summary> | |
/// Checks if string is empty, null or white space | |
/// </summary> | |
/// <param name="value"></param> | |
/// <returns></returns> | |
public static bool IsEmpty(this string value) | |
{ | |
return string.IsNullOrEmpty(value) || string.IsNullOrWhiteSpace(value); | |
} | |
/// <summary> | |
/// Checks if string is not empty, null or white space | |
/// </summary> | |
/// <param name="value"></param> | |
/// <returns></returns> | |
public static bool IsNotEmpty(this string value) | |
{ | |
return !string.IsNullOrEmpty(value) && !string.IsNullOrWhiteSpace(value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment