Skip to content

Instantly share code, notes, and snippets.

@The-Running-Dev
Created December 25, 2020 18:47
Show Gist options
  • Save The-Running-Dev/823b52f1f1c647990c5ef75b9d52710a to your computer and use it in GitHub Desktop.
Save The-Running-Dev/823b52f1f1c647990c5ef75b9d52710a to your computer and use it in GitHub Desktop.
String Extensions
/// <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