string str = "hello@123:*&^789'!@#$*()_+="; int count = 0; foreach (char c in str) { if (!char.IsLetterOrDigit(c.ToString(),0)) { count++; } } MessageBox.Show(count.ToString());
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)