只能为中文输入

 /// <summary>
        /// 判断字符串是否全为中文
        /// </summary>
        /// <param name="words"></param>
        /// <returns></returns>
        public static bool WordsIScn(string s)
        {
            for (int i = 0; i < s.Length; i++)
            {
                Regex rx = new Regex("^[\u4e00-\u9fa5]$");
                if (!rx.IsMatch(s[i].ToString()))
                {
                    return false;
                }
            }
            return true;
        }

posted @ 2009-12-11 16:41  流光one  阅读(129)  评论(0编辑  收藏  举报