RE: String comparation
Cathy, You'd need to write a dedicated sort routine that would understand the meaning inside your strings. As it stands, the strings are sorting the way they should if they are viewed simply as plain character based data. Or if you know that the numerical digits on the end of the strings need to be sorted, you could try putting leading zeroes infront of them. That would then give you a sort sequence of test01, test02, test10. Hope this helps. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 >-Original Message- >From: Cathy Osekizoglu [mailto:hinbsls@;yahoo.ca] >Sent: Thursday, October 17, 2002 10:18 AM >To: [EMAIL PROTECTED] >Subject: String comparation > > > >This question is not related to struts. Sorry I ask here >because I don't know where I should put this message. Please >help me forward to the right place if you know. > >If you know the answer, please help me. Thanks. > >My question: > >How to compare test1, test10 and test2, > >so that the result will be test1, test2, test10. Now I got >test1, test10, test2 > >Thanks again > > > >- >Post your free ad now! Yahoo! Canada Personals > -- To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>
String comparation
This question is not related to struts. Sorry I ask here because I don't know where I should put this message. Please help me forward to the right place if you know. If you know the answer, please help me. Thanks. My question: How to compare test1, test10 and test2, so that the result will be test1, test2, test10. Now I got test1, test10, test2 Thanks again - Post your free ad now! Yahoo! Canada Personals
Re: String comparation
Make your classes implement the 'Comparable' interface - http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html Kevin Cathy Osekizoglu <[EMAIL PROTECTED]> on 10/17/2002 11:18:13 AM Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]> To:[EMAIL PROTECTED] cc: (bcc: Kevin Bedell/Systems/USHO/SunLife) Subject:String comparation This question is not related to struts. Sorry I ask here because I don't know where I should put this message. Please help me forward to the right place if you know. If you know the answer, please help me. Thanks. My question: How to compare test1, test10 and test2, so that the result will be test1, test2, test10. Now I got test1, test10, test2 Thanks again - Post your free ad now! Yahoo! Canada Personals --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender and erase this e-mail message immediately. --- -- To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>
Re: String comparation
You should post this question to the sun java forums at forum.java.sun.com. Also, you're not comparing you're sorting. David From: Cathy Osekizoglu <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: String comparation Date: Thu, 17 Oct 2002 11:18:13 -0400 (EDT) This question is not related to struts. Sorry I ask here because I don't know where I should put this message. Please help me forward to the right place if you know. If you know the answer, please help me. Thanks. My question: How to compare test1, test10 and test2, so that the result will be test1, test2, test10. Now I got test1, test10, test2 Thanks again - Post your free ad now! Yahoo! Canada Personals _ Get faster connections -- switch to MSN Internet Access! http://resourcecenter.msn.com/access/plans/default.asp -- To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>