天天看点

c# 判断字符串是否包含字母数字

public static bool IsNumber(String str)
        {
            bool result = false;
            for (int i = 0; i < str.Length; i++)
            {
                if (Char.IsNumber(str, i))
                {
                    return true;
                }
            }
            return result;
        }

       
        public static bool isLetter(string str)
        {
            return Regex.Matches(str, "[a-zA-Z]").Count > 0;
        }
           
c#