判断字符串是否是null 或 trim() == "" - IsNullOrEmptyAndBlankString
2017-02-05 10:42:14 访问(1379) 赞(0) 踩(0)
/// <summary>
/// 判断字符串是否是null 或 trim() == ""
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsNullOrEmptyAndBlankString(string str)
{
if (str == null)
return true;
if (str.Length == 0)
return true;
if (str.Trim().Length == 0)
return true;
return false;
}
/// <summary>
/// 判断字符串是否不是null 或 trim() == ""
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static bool IsNotNullOrEmptyAndBlankString(string str)
{
return !IsNullOrEmptyAndBlankString(str);
}
标签:
判断字符串是否是null 或 trim() == "" - IsNullOrEmptyAndBlankString 


上一条:
下一条:
相关评论
发表评论