I am working on a program that lets a user input an alphanumeric key, and checks if it is a valid key against some criteria, one of these is whether or not the key contains an uppercase. TThis is what I have tried so far:
else if (key.contains("QWERTYUIOPASDFGHJKLZXCVBNM")){
UI.println("Invalid, key contains a space, illegal character");
}
This only detects the capital letters if they are written in this order. is there a command such as key.contains i should be using?