[Solved] How can I take a part of a string and sort it in reverse alphabetical order? [duplicate]


A simple way:

String str = "Good Morning";
String subStr=str.substring(0,7);
char[] arr = subStr.toCharArray();
Arrays.sort(arr); 
for(int i = arr.length - 1; i >= 0; i--) 
System.out.print(arr[i]);

solved How can I take a part of a string and sort it in reverse alphabetical order? [duplicate]