字符串是否为空或是否数值
2017-01-25 17:25:31 访问(1464) 赞(0) 踩(0)
/// <summary>
/// 字符串是否为空或是否数值
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public bool StrIsEmptyOrDouble(string str)
{
if (str == null)
return true;
if (str.Length == 0)
return true;
str = str.Trim();
if (str.Length == 0)
return true;
double theValue = -1;
return double.TryParse(str, out theValue);
}
标签:
字符串是否为空或是否数值 


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