Skip to content

Commit ca8f6db

Browse files
author
khalil2535
committed
Update Caesar.java
1 parent 9060d2d commit ca8f6db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ciphers/Caesar.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public static String encode(String message, int shift) {
3434
// int current = message.charAt(i); //using char to shift characters because ascii is in-order latin alphabet
3535
char current = message.charAt(i); // Java law : char + int = char
3636

37-
if (current >= 'A' && current <= 'Z') {
37+
if (IsCapitalLatinLetter(current)) {
3838

3939
current += shift;
4040
encoded += (char) (current > 'Z' ? current - 26 : current); // 26 = number of latin letters
4141

42-
} else if (current >= 'a' && current <= 'z') {
42+
} else if (IsSmallLatinLetter(current)) {
4343

4444
current += shift;
4545
encoded += (char) (current > 'z' ? current - 26 : current); // 26 = number of latin letters

0 commit comments

Comments
 (0)