java sort string array according to kurdish characters -
is there short way sort string array kurdish characters? i've looked @ source on internet couldn't find solution. there way sort. writing code alike novel long work.
kurdish characters: a,b,c,ç,d,e,ê,f,g,h,i,î,j,k,l,m,n,o,p,q,r,s,ş,t,û,u,v,w,x,y,z
the collator class should come in-handy here. quote doc,
the collator class performs locale-sensitive string comparison. use class build searching , sorting routines natural language text.
so try this:
collator unicodecollator = collator.getinstance(locale.unicode_locale_extension); collections.sort(yourlistofcharacters, unicodecollator);
note able call java.util.collections.sort
directly above, because collator implements comparator interface.
if whatever reasons locale.unicode_locale_extension
doesn't work, here's full list of supported locales. , can create own locale using locale constructor.
Comments
Post a Comment