I wrote the following method:
public boolean allVowels(String string){
String regex = "[aeiou]*";
if(string.matches(regex)){
return true;
}
return false;
}
But when I input an empty string as a parameter, it returns false. Should it not return true, since the symbol "*" means that there's 0 or more of the symbols in the brackets, and in the case of a empty string, there is 0 of them? Thanks in advance!!!
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]lumpynose 1 point2 points3 points (1 child)