string ptn = "[\u4e00-\u9fa5]+|[a-zA-Z\\s]+";
            System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(ptn);
            string z = "I我IS是Chinese中国人";            foreach (Match m in reg.Matches(z))
            {
                Console.WriteLine(m.Value);
            }你要的不

解决方案 »

  1.   

    string str="I我IS是Chinese中国人";
            public static string GetChina(string text)
            {
                string newStr = "";
                foreach (char c in text.ToCharArray())
                {
                    if (Regex.IsMatch(c.ToString(), @"^[\u4e00-\u9fa5]+$") == true)
                    {
                        newStr = newStr + c.ToString();
                    }
                }
                return newStr;
            }
                MessageBox.Show(GetChina(str));
      

  2.   

    string str=""; 
    if (Regex.IsMatch(str, @"^[\u4e00-\u9fa5](\s*[\u4e00-\u9fa5])*$"))
            {        }
            else
            {
                
            }