This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Sorting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sorting" Watch "Sorting" New topic
Author

Sorting

Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 289

Hi all

I need to Sort the String which is like "200036.9116.2.5.1.16.1613454297". which have the number separated by the period(.).


And its Unique. Please give me some ideas..


-Chiru
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41133
    
  45
What does it mean to sort a string? What would this particular string look like after "sorting"?

You can obtain a list of all substrings using a String.split("\\.") method call.


Ping & DNS - my free Android networking tools app
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11164
    
  16

do you want to take a single string, break out the parts, and sort those?

or will you have dozens of strings like this, and you want to sort all of those based on various fields within the string?

and what do you mean by "it's unique"?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Sorting
 
Similar Threads
Ant Build Successful but neither jar file nor build folder created ?
Websphere docs
Parking the car....
Jboss Experts - Bangalore
how can i insert a null value in a table