Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String makeCorrect(String str) {
- String correctStr = "";
- char ch;
- for(int i = 0; i < str.length(); i++) {
- ch = str.charAt(i);
- if ((ch >= 'а' && ch <= 'я') || (ch >= 'А' && ch <= 'Я') || ch == 'ё' || ch == 'Ё') {
- if((ch >= 'а') && (ch <= 'я') || ch == 'ё') {
- ch = Character.toUpperCase(ch);
- }
- correctStr += ch;
- }
- }
- return correctStr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement