I know that I could do this with a series of for loops that iterate through the string but that would be terrible programming. Well, my professor prefers I don\'t do it this
If you are looking to check whether your string contains uppercase letter or not, you can use below pattern:
String s="abcDe_shdgwU"; //you can have any String here
if(s.matches(".*[A-Z].*"))
System.out.println("The String contains Uppercase letter(s)");
else
System.out.println("does not contain Uppercase letter(s)");
Hope that helps. Thank you. Regards, Tanumay Saha