Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sorting an arraylist in ascending order

user8696578Dec 5 2013 — edited Dec 8 2013

Hi All,

I have an ArrayList of type String.

The values are like below:

1206 Grocery

1107 Oil

3001 Food

So I want to show in ascending order based on the first 4 digit of the String and should yield the result as below:-

1007 Oil

1206 Grocery

3001 Food.

Thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2014
Added on Dec 5 2013
3 comments
842 views