This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool validatePassword(String password) { | |
// Check if the password has exactly 6 characters | |
if (password.length != 6) { | |
return false; | |
} | |
// Check if the password contains at least one uppercase letter | |
bool hasUppercase = false; | |
for (int i = 0; i < password.length; i++) { | |
if (password[i] == password[i].toUpperCase() && password[i] != password[i].toLowerCase()) { |