🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #3186

Re: [java] strings controleren op alfabetische volgorde

#3186
From: Matthijs Laan
Date: Fri, 23 Jan 2004 16:11
15 lines
1681 bytes
Passero wrote:

> Hoe kan ik in java 2 strings controleren op alfabetische volgorde. Dus
> zo iets in den aard van: if(string1 > string2) daaruit volgt dat
> string1 na string2 komt dus dat string1 bijvoorbeeld peer is en
> string2 appel. Ik zou die dus moeten kunnen sorteren. Iemand enig
> idee? 
> 

Normaliter kan je String.comareTo() gebruiken. Om locales in de 
vergelijking mee te nemen kan je een Collator gebruiken:

http://java.sun.com/j2se/1.4.2/docs/api/java/text/Collator.html

Matthijs
Technical Details
Message-ID: <Xns9479AEE19DED2matthijsln@news.xs4all.nl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsgate.cistron.nl!transit.news.xs4all.nl!newsfeed.xs4all.nl!xs4all!not-for-mail
References: <KwbQb.1839$Ff4.56376@phobos.telenet-ops.be>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: 107324,fde668a8bcb8de20
X-Google-Attributes: gid107324,public
X-Google-Thread: fcea4,fde668a8bcb8de20
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2004-01-23 08:11:30 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsgate.cistron.nl!transit.news.xs4all.nl!newsfeed.xs4all.nl!xs4all!not-for-mail
Newsgroups: be.comp.programming,nl.comp.programmeren
Subject: Re: [java] strings controleren op alfabetische volgorde
From: Matthijs Laan <matthijsln@nospam-remove.xs4all.nl>
References: <KwbQb.1839$Ff4.56376@phobos.telenet-ops.be>
Message-ID: <Xns9479AEE19DED2matthijsln@news.xs4all.nl>
User-Agent: Xnews/06.07.17
X-Face: ./Iyf!u(N\'up#=y6brL]rn2zIIdkg9_~rPFP]fx`}gz:c7gO~4:GIM+;uUU$@;mR7Asr9ROcI0[>m7XUqyw1WZl97#h2&FnqYQHg1Qcb>4ro/~i1ta~gtzQAha~R=<1XN:9?zCu}xoGWKfFc6DUph3.aa]tUvo6A#u*OQ^TN4?cA=q)V(BfV:yAVbPK_+mwZ7I<o0%#fH,u\E?atp(WF
Date: 23 Jan 2004 16:11:29 GMT
Lines: 15
NNTP-Posting-Date: 23 Jan 2004 17:11:29 CET
NNTP-Posting-Host: 80.126.238.157
X-Trace: 1074874289 news.xs4all.nl 314 [::ffff:80.126.238.157]:39579
X-Complaints-To: abuse@xs4all.nl