Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Sorting a list of delimited numbers...

Started 1 month, 3 weeks ago by brewerdc
Hello, I'm having trouble sorting a list of "." delimited numbers. The number of delimiters can be infinite as well as the length of the number between delimiters. For example... Input (ArrayList of these values): 1.1.1 1.2.1 2.1 1.10 2.20 2.2.1 2.2.10 2.2.2 1.10 I'm currently getting this as output: 1.1.1 1.10 1.10 1.2 2.1 2.2.1 2.2.10 2.2.2...
Site: CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions  CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions - site profile
Forum: C-Sharp Programming  C-Sharp Programming - forum profile
Total authors: 3 authors
Total thread posts: 4 posts
Thread activity: no new posts during last week
Domain info for: codeguru.com

Other posts in this thread:

BigEd781 replied 1 month, 3 weeks ago
You will have to create you own custom comparer because this: 1.1.1 is not a number. The most simple method would probably be to split on the delimiter and compare each piece in sequence.

brewerdc replied 1 month, 3 weeks ago
I'm trying to use a jagged array (not sure if this is the way to go about it) and trying to sort from Left to Right while maintaining indices. Have a simple code sample that would achieve what you're saying to do? Thanks again for the help!

dglienna replied 1 month, 3 weeks ago
Write a module that compares a number to the highest number in the list. It can split the new value, and determine whether to add everything else BEFORE the old list, or add the new number AT THE END of the list.

 

Top contributing authors

Name
Posts
brewerdc
2
user's latest post:
Sorting a list of delimited...
Published (2009-11-05 20:46:00)
I'm trying to use a jagged array (not sure if this is the way to go about it) and trying to sort from Left to Right while maintaining indices. Have a simple code sample that would achieve what you're saying to do? Thanks again for the help!
BigEd781
1
user's latest post:
Sorting a list of delimited...
Published (2009-11-05 17:33:00)
You will have to create you own custom comparer because this: 1.1.1 is not a number. The most simple method would probably be to split on the delimiter and compare each piece in sequence.
dglienna
1
user's latest post:
Sorting a list of delimited...
Published (2009-11-05 23:54:00)
Write a module that compares a number to the highest number in the list. It can split the new value, and determine whether to add everything else BEFORE the old list, or add the new number AT THE END of the list.

Related threads on "CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions":

Related threads on other sites:

Thread profile page for "Sorting a list of delimited numbers..." on http://www.codeguru.com. This report page is a snippet summary view from a single thread "Sorting a list of delimited numbers...", located on the Message Board at http://www.codeguru.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity