FalconSSO/FAuth/Extensions/StringExtend.cs

21 lines
817 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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();
}
}