Add project files.

This commit is contained in:
2023-04-29 09:17:17 +03:00
commit 62178f1f32
493 changed files with 45863 additions and 0 deletions
@@ -0,0 +1,29 @@
namespace MyOffice.Core.Extensions;
public static class StringExtensions
{
public static bool IsMissing(this string? str)
{
return str == null || string.IsNullOrEmpty(str) || string.IsNullOrEmpty(str.Trim());
}
public static bool IsPresent(this string? str)
{
return !IsMissing(str);
}
public static string? NullIfEmpty(this string? str)
{
return IsMissing(str) ? null : str;
}
public static bool EqualsIgnoreCase(this string? str, string? value)
{
return str != null && str.Equals(value, StringComparison.OrdinalIgnoreCase);
}
public static bool AsBool(this string? str, bool defaultValue = false)
{
return true.ToString().Equals(str, StringComparison.OrdinalIgnoreCase) || defaultValue;
}
}