samedi 20 juillet 2019

How would I check to see if the password has an uppercase letter?

I am working on a project where I need to find out if the password has an uppercase letter. On Codecademy it wants you to use Tools.Contains(); but I don't see this code anywhere nor will it allow me to use it in Visual Studio. Is there a proper way of doing this?

I have tried looking everywhere but cannot find the Tools.Contains code anywhere.

        //variables
        int minLength = 8;
        string uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        string lowercase = "abcdefghijklmnopqrstuvwxyz";
        string digits = "0123456789";
        string specialChars = "!#$%&*";
        int score = 0;

        //User
        Console.WriteLine("Enter a password:");
        string password = Console.ReadLine();

        //Points
        if (minLength >= 8)
        {
            score++;
        }
        if (Tools.Contains(password, uppercase))
        {

        }

Aucun commentaire:

Enregistrer un commentaire