Whitespace

This commit is contained in:
Chris Cameron
2018-01-16 13:05:35 -05:00
parent e26d77c827
commit e4be5e7e7c
4 changed files with 170 additions and 177 deletions

View File

@@ -523,20 +523,18 @@ namespace ICD.Common.Utils
return text == null ? null : new string(text.Where(c => !Char.IsWhiteSpace(c)).ToArray());
}
/// <summary>
/// Returns true if the string is entirely whitespace characters, or empty, or null.
/// </summary>
/// <param name="text"></param>
/// <returns></returns>
public static bool IsNullOrWhitespace(string text)
{
if (string.IsNullOrEmpty(text))
{
return true;
}
var trimmed = text.Trim();
return trimmed.Length == 0;
}
/// <summary>
/// Returns true if the string is entirely whitespace characters, or empty, or null.
/// </summary>
/// <param name="text"></param>
/// <returns></returns>
public static bool IsNullOrWhitespace(string text)
{
if (string.IsNullOrEmpty(text))
return true;
string trimmed = text.Trim();
return trimmed.Length == 0;
}
/// <summary>
/// Returns the password as a series of *s