检测字符串是否是数字

#region public bool ClassIsNumeric(string str):检测字符串是否是数字
        /// <summary>
        /// 检测字符串是否是数字
        /// </summary>
        /// <param name="str">string类型。待检测字符串</param>
        /// <returns>bool类型。字符串是数字则返回真,否则返回假</returns>
        public bool ClassIsNumeric(string str)
        {
            return !(new Regex("[^0-9]").Match(str).Success);
        }
        #endregion

原文地址:https://www.cnblogs.com/wuhuisheng/p/1807488.html