找出含多少个字母和数字
/// <summary> /// 找出含多少个字母和数字 /// </summary> public int GetLetterOrDigitCount(string value) { int count = 0; for (int i = 0; i < value.Length; i++) { var ch = value[i]; if (ch >= 'a' && ch <= 'z') { count++; continue; } if (ch >= 'A' && ch <= 'Z') { count++; continue; } if (char.IsNumber(ch)) { count++; continue; } } return count; }

浙公网安备 33010602011771号