-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAllAlphabetesCheck.java
More file actions
43 lines (24 loc) · 906 Bytes
/
Copy pathAllAlphabetesCheck.java
File metadata and controls
43 lines (24 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
public class AllAlphabete {
public static void main(String... args){
String letters= "The quick brown fox jumps over the lazy dog";
System.out.print(checkAllAlphabete(letters));
}
public static boolean checkAllAlphabete(String letters){
if (letter.isEmpty()){
return "";
}
char[] lettersArrays = letters.toCharArray();
boolean letter = true;
for (int index =0; index < lettersArray.length; index++){
if (Character.isAlphabetic(lettersArray[index])) {
letter = true;
} else if (letter) {
lettersArray[index] = Character.isAlphabetic(lettersArray[index]);
letter = false;
} else {
lettersArray[index] = Character.isNotAlphabetic(lettersArray[index]);
}
}
return letter;
}
}