Sorting String with non-western characters

前端 未结 6 1775
醉话见心
醉话见心 2020-12-15 01:49

I wanted to print sorted Polish names of all available languages.

import java.util.*;

public class Tmp
{
  public static void main(String... args)
  {
    L         


        
6条回答
  •  Happy的楠姐
    2020-12-15 02:12

    Unfortunately in Polish ł comes after l and before m so the output should be:

    You can define your own Compararable or Comparator interface.

    Or also this might help you:

    • Sort List of Strings with Localization

提交回复
热议问题