Falcon.Extend/Falcon.Extend/StringExtend.cs

27 lines
857 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 Falcon.Extend
{
/// <summary>
/// 字符串处理扩展
/// </summary>
public static class StringExtend
{
/// <summary>
/// 是否为Null或Empty
/// </summary>
/// <param name="str">要判断的字符串</param>
/// <returns>如果为Null或Empty返回True否则False</returns>
public static bool IsNullOrEmpty(this string str) {
return str == null ? true : string.IsNullOrEmpty(str);
}
/// <summary>
/// 是否为Null或Empty
/// </summary>
/// <param name="str">要判断的字符串</param>
/// <returns>如果为Null或Empty返回True否则False</returns>
public static bool IsNotNullOrEmpty(this string str) {
return !str.IsNullOrEmpty();
}
}
}