-
-
Save parzibyte/4d3642f1371e382e838ef3db6990cd5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static String solicitarPalabra() { | |
Scanner sc = new Scanner(System.in); | |
while (true) { | |
System.out.println("Ingresa la palabra: "); | |
String palabra = sc.nextLine(); | |
if (palabra.indexOf(" ") != -1) { | |
System.out.println("No puedes ingresar una frase"); | |
} else if (palabra.length() < 10) { | |
System.out.println("La longitud mínima es de 10"); | |
} else { | |
return palabra; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment