The task is to sort all the letters in a string alphabetically. The program should ignore case when sorting.
I wrote this code:
char[] charstr = str.toCharArray(); Arrays.sort(charstr, (char a , char b) -> {Character.compare(Character.toLowerCase(a) , Character.toLowerCase(b))}); str = new String(charstr); I receive a message that is not enough ; but the syntax seems to be correct. Who can tell what the error is?
.toLowerCase(b));}). - ߊߚߤߘ