mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-11 02:35:05 +00:00
Whitespace
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user