if (usrPass.length() >= 6) {
for (int i = 0; i < usrPass.length(); i++) {
passCh = usrPass.charAt(i);
if (passCh == ' ') {
b = true; //Bad
System.out.println("got a space at" +i);
}
if (Character.isUpperCase(passCh))
c = true; //Good
if (Character.isLowerCase(passCh))
d = true; //Good
if (Character.isDigit(passCh))
e = true; //Good
}
}
This is a sample of a loop im running, usrPass is sent in from a keyboard input.
Problem i'm having is it works perfect if the white space is in the middle but if its leading or trailing the string its ignored. so
" x aa "
it would only start counting/finding them after the x and stop after the last a.