FalconSSO/FAuth/Extensions/StringExtend.cs

21 lines
817 B
C#
Raw Normal View History

2020-03-30 10:12:52 +08:00
namespace FAuth.Extensions
{
public static class StringExtend
{
/// <summary>
/// 扩展判断字符串是否为null或空方法
/// </summary>
/// <param name="str">字符串</param>
/// <returns>如果为Null或Empty或空返回True否则返回false</returns>
public static bool IsNullOrEmpty(this string str) {
return str == null ? true : str == string.Empty ? true : str == "" ? true : false;
}
/// <summary>
/// 判断字符串是否非空
/// </summary>
/// <param name="str">字符串</param>
/// <returns>如果为Null或Empty或空返回False否则返回True</returns>
public static bool IsNotNullOrEmpty(this string str) => !str.IsNullOrEmpty();
}
}