Created
February 26, 2020 18:01
-
-
Save parzibyte/55fba509bb1e5dfa988e49f5d7639f3a 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
public static boolean contieneSoloLetras(String cadena) { | |
for (int x = 0; x < cadena.length(); x++) { | |
char c = cadena.charAt(x); | |
// Si no está entre a y z, ni entre A y Z, ni es un espacio | |
if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == ' ')) { | |
return false; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment