Checkpoint 1.33.1.
The function
isValidPassword()
takes a String input, password, and returns a boolean. Complete the function by filling in the blanks so it returns false when the password is less than 8 characters or contains any spaces. Otherwise, it returns true.- You can use the
length()
function to check the length of any String. For example: password.length() returns the length of password. - You can use the
contains()
function to check whether a String contains a specific substring. For example, password.contains("a") returns true when password has a substring "a".
public static boolean isValidPassword(String password) {
return .....Blank............... ;
}
Write your responses here:
Blank: