摘要: string pat = "你好么123"; string str = Regex.Replace(pat, @"[^\d.\d]", ""); int result = 0; if (Regex.IsMatch(str, @"^[+-]?\d*[.]?\d*$")) { result = Convert.ToInt32(str); }//结果:result=123; 阅读全文
posted @ 2016-04-19 19:00 苍 阅读(352) 评论(0) 推荐(0) 编辑