java - Incorrect evaluation of String using Collator -


i'm trying use collator fast way sort 2 string using following code:

public static void main(string[] args) {     string str1 = "test sortowania";     string str2 = "testowanie sortowania jeszcze raz";      system.out.println(compare(str1,str2));  }  public static int compare(string s0, string s1) {     boolean ignorecase = true;     collator c = collator.getinstance(new locale("pl", "pl"));     return (ignorecase ? c.compare(s0.touppercase(new locale("pl", "pl")),             s1.touppercase(new locale("pl", "pl"))) : c.compare(s0, s1)); } 

as result got 1, means "test sortowania" > "testowanie sortowania jeszcze raz".

however think should opposite, space character should less 'o'.

am missing something?


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -