2011年8月14日 星期日

[.NET] C# 常用function整理(四) 是否為數字







#region IsNumber()
///
/// 是否為數字
///

/// ///
protected bool IsNumber(string CheckStr)
{
Regex reg = new Regex("\\d", RegexOptions.Compiled | RegexOptions.IgnoreCase);

return reg.IsMatch(CheckStr, 0);
}
#endregion

沒有留言:

張貼留言