I'm trying to make my program check if input is a string (Only alphabetical characters) but it displ

First of all your code hardly makes sense at all, and is difficult to read with all the extra whitespace. First, I don't know what you are trying to achieve here:
string output = string.Empty;
if (output == string.Empty) ;
{
    //     Console.WriteLine("Invalid Input");
}

If you uncomment the WriteLine it will always print "Invalid Input". Then, over here you aren't doing anything to show the invalid input. All you're doing is printing a line:
if (key < 1)
    //          Console.WriteLine("Invalid Input");
    Console.WriteLine("____");

else if (key >= 36)
    //        Console.WriteLine("Invalid Input");
        Console.WriteLine("Encrypted Data");

BTW, when you write untidy code like this you are going to get bitten from not using braces in your if statements
Then over here:
for (int i = 0; i < UserString.Length; i++)
{
    if (UserString[i] >= 'a' && UserString[i] <= 'z' || UserString[i] == ' ')
    {
        check = true;
        continue;
    }
    else
    {
        check = false;
        Console.Write("Invalid Input");
        break;
    }

}
if (check == false)
{
    UserString = Console.ReadLine();

}

you're using Console.Write instead of Console.WriteLine so nothing will get output
Was this page helpful?