0

How to sort the List of strings containing Hindi names or using special characters or using digits in Java?

For example:

input:
[!@#,hindi,अभिवादन,12dhs]
output:
[अभिवादन,!@#,12dhs,hindi]
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • 3
    Do you know how to sort lists in general? Do you know how to sort lists of strings in general? If so, what did you try so far, and if not, what research did you do? - If you have done all this, what exactly are your requirements for sorting? Does the default collator produce the wrong results? – Thomas Jul 11 '22 at 06:31
  • 1
    You'd normally use a `Collator` for locale specific sorting, but I just tried that, and it looks like Locales hi, hi_IN and hi_IN_#Deva don't have the sorting rules you expect. – Mark Rotteveel Jul 11 '22 at 06:54
  • Does this answer your question? [How to sort a List alphabetically using Object name field](https://stackoverflow.com/questions/8432581/how-to-sort-a-listobject-alphabetically-using-object-name-field) – pringi Jul 11 '22 at 13:09

0 Answers0