regex name

dwfq
 avatar
unknown
java
3 years ago
456 B
6
Indexable
public static boolean validaNombre(String nombre){
        List<String> nombres = Arrays.asList(nombre.split(" "));
        
        int countAux = 0;
        for(int i = 0; i < nombres.size(); i++){
            
            if(nombres.get(i).matches("^[A-Za-z]*$"))
                countAux++;
            
            if(countAux == nombres.size()){
                return true;
            }
        }
        
        return false;
    }
Editor is loading...