首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

继续上次的有关问题。如果是全角怎么处理

2012-01-20 
继续上次的问题。如果是全角怎么办?如题上一贴:http://community.csdn.net/Expert/topic/5732/5732206.xml?

继续上次的问题。如果是全角怎么办?
如题
上一贴:http://community.csdn.net/Expert/topic/5732/5732206.xml?temp=.7683679

[解决办法]
/// <summary>
/// Function to test whether the string is valid number or not.
/// </summary>
/// <param name= "str "> string. </param>
/// <returns> Return true if str is number. </returns>
public static bool IsNumber(String str)
{
return Regex.IsMatch(str, "(^[-]?[0-9]*[.]?[0-9]+$) ");
}

是否是数字


如果不是不让输入.

热点排行