Question: I'm trying to make insult program for. I wanted to use arrays to store the entire alphabet from `a` to `z`. I have used the `if statement` so when the user presses the letter `a` something happens. And, if he presses anything but a letter, something else happens. I'm stuck now.

```
class Program
{

    static void Main(string[] args)
    {

        Console.WriteLine("Type any bastard letter!!!");
        ConsoleKeyInfo keyInfo = Console.ReadKey();

        char[] array1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };

        if (keyInfo.KeyChar == 'a')
        {
            SpeechSynthesizer synth = new SpeechSynthesizer();
            Console.WriteLine("You have typed a letter");
            synth.Speak("You have typed a letter");

        }

        else
        {
            SpeechSynthesizer synth = new SpeechSynthesizer();
            Console.WriteLine(" ");
            Console.WriteLine("did you type {0}", keyInfo.KeyChar.ToString());
            synth.Speak("You have typed a bastard number you infentile pillock");
        }

    }
}

```

Answer: 
Without iterating, just use the following expression:

```
if (array1.Contains(keyInfo.KeyChar)) // a letter has been typed...
{
    // ...
}
else
{
    // ...
}

```
I assume that when you say "making the array work", you mean "I want to test if the letter typed at the beginning is in the array".

```
char[] array1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };

if (array1.Contains(keyInfo.KeyChar)) 
{ 
    // user typed a letter
} 
else 
{
    // user typed not a letter
}

```

I tried to show you how to check if something is in an array in C#. But since your goal is to check if the character is a letter, there is even better : `Char.IsAlpha()` ([documentation here](https://msdn.microsoft.com/en-us/library/yyxz6h5w(v=vs.110).aspx)) (and also `IsDigit()` ([documentation](https://msdn.microsoft.com/en-us/library/7f0ddtxh(v=vs.110).aspx)) .

In this case you don't need your initial array at all :

```
if (Char.IsAlpha(keyInfo.KeyChar)) 
{
    // character is a letter (will work for both lowercase or uppercase)
}
else if (Char.IsDigit(keyInfo.KeyChar))
{
    // character is a digit
}
else 
{
    // char is neither a digit or a letter
}

```

And, finally another way that doesn't involve arrays and strictly equivalent to your initial approach (thanks @JeppeStigNielsen in comments) :

```
if (keyInfo.KeyChar >= 'a' && keyInfo.KeyChar <= 'z') 
{
    // character is a lowercase letter from English-alphabet 
}
else if (keyInfo.KeyChar >= '0' && keyInfo.KeyChar <= '9')
{
    // character is a digit
}
else 
{
    // char is neither a digit or a letter
}

```

This works because a char is actually the code number of the corresponding character, and codes for letters (or digits) are consecutive values. [see here for the list of Unicode codes](https://en.wikipedia.org/wiki/List_of_Unicode_characters#Basic_Latin)