Link to home
Start Free TrialLog in
Avatar of Jason
JasonFlag for Australia

asked on

Sort arraylist

I have an arraylist

User generated image
I need to sort array by the number before the comma

I need it with lowest to highest
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

I would suggest to split up the values into a small helper class, and compare using the proper parts with the propert data types. which means to sort by "part(6)" from the source data

trying to sort like this after the string concatenation is not really efficient...

hence, can you not sort the "input" instead?
Avatar of Jason

ASKER

If i separate them how do you keep the association between them
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jason

ASKER

Great works awesome
Only using arraylist because it is extracted from another arraylist
will need to look at LINQ.

Thx heaps