private void button1_Click(object sender, EventArgs e)
{
var AlphNumber = AlphNumberBox.Text;
var AlphNumbersArr = AlphNumber.ToCharArray(0,9);
char[] ConvNumbersArr = new char[10];
int i = 0;
foreach (var character in AlphNumbersArr; i++)
{
if (char.IsLetter(character))
{
if (character == 'A' || character == 'B' || character == 'C')
{
ConvNumbersArr[i] = '2';
}
if (character == 'D' || character == 'E' || character == 'F')
{
ConvNumbersArr[i] = '3';
}
if (character == 'G' || character == 'H' || character == 'I')
{
ConvNumbersArr[i] = '4';
}
if (character == 'J' || character == 'K' || character == 'L')
{
ConvNumbersArr[i] = '5';
}
if (character == 'M' || character == 'N' || character == 'O')
{
ConvNumbersArr[i] = '6';
}
if (character == 'P' || character == 'Q' || character == 'R' || character == 'S')
{
ConvNumbersArr[i] = '7';
}
if (character == 'T' || character == 'U' || character == 'V')
{
ConvNumbersArr[i] = '8';
}
if (character == 'W' || character == 'X' || character == 'Y' || character == 'Z')
{
ConvNumbersArr[i] = '9';
}
}
}
}