public static bool IsDigit(string tcString)
{
//get the first character in the string
char c = tcString[0];
return Char.IsDigit(c);
}
private void button1_Click(object sender, EventArgs e)
{
char[] letters = new char[50];
int len = textBox1.Text.Length;
for (int j = 0; j < len; j++)
{
letters[j] = Convert.ToChar(textBox1.Text.Substring(j, 1));
}
for (int i = 0; i < len; i++)
{
bool result = IsDigit(letters[i].ToString());
if (result == true)
{
MessageBox.Show(letters[i] + "is a digit");
}
}
}