I am trying to sort the JSONObject array in Java. Can someone please tell me how can I sort based on locale in Java just similar to JavaScript's localeCompare()?
In JavaScript, we can do locale sort like below,
arr.sort( ( a, b ) => a.data[ "nested-name" ].localeCompare(b.data[ "nested-name" ]) )
I want to do locale compared sorting in Java.