21 lines
817 B
C#
21 lines
817 B
C#
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();
|
||
}
|
||
}
|