如何在长度100的字符串中找出是否有数字??知道的教下,谢谢了

解决方案 »

  1.   

    通过正则表达式,
                string s = "asdfasdfbasf";
                System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex("[0-9]+");
                if (reg.IsMatch(s))
                {
                    MessageBox.Show("有");
                }
                else
                {
                    MessageBox.Show("没有");
                }