Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes Sorting of string elements in alphabetical order Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sorting of string elements in alphabetical order" Watch "Sorting of string elements in alphabetical order" New topic
Author

Sorting of string elements in alphabetical order

lmahesh kumar
Greenhorn

Joined: Feb 27, 2003
Posts: 15
Hi,

I am having an string array of some size.
\
I want to sort in alphabetical order .

Pls give me the logic or simple example .



ThankS.
Mahesh L.
=========
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Collections.sort(Arrays.asList(yourArray));
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
Or Arrays.sort(array). There's a version that takes a Comparator if you need to do case-insensitive sorting: Arrays.sort(array, String.CASE_INSENSITIVE_ORDER).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sorting of string elements in alphabetical order
 
Similar Threads
Reordering Alphabets
searching method for a Binary Search Tree
Looping through HashMap
poll(),peek() in PriorityQueue class
Question regarding Eclipse