Advertisement
dxvmxnd

Untitled

Feb 20th, 2025
4
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public static String makeCorrect(String str) {
  2. String correctStr = "";
  3. char ch;
  4.  
  5. for(int i = 0; i < str.length(); i++) {
  6. ch = str.charAt(i);
  7. if ((ch >= 'а' && ch <= 'я') || (ch >= 'А' && ch <= 'Я') || ch == 'ё' || ch == 'Ё') {
  8. if((ch >= 'а') && (ch <= 'я') || ch == 'ё') {
  9. ch = Character.toUpperCase(ch);
  10. }
  11. correctStr += ch;
  12. }
  13. }
  14.  
  15. return correctStr;
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement