By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
 435,154 Members | 1,050 Online
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,154 IT Pros & Developers. It's quick & easy.

# while sorting an Integer array, numbers are sorting wrongly.

 P: 1 Hi, suppose an array consists of values dim arrnum() as integer=nothing arrnum consists of values (3,8,6,15,2,10) while using Array.sort(arrnum) valuse are sorted like way. (10,15,2,3,6,5) actually i need values in a sorted way. can you help me out. thanks, Feb 17 '14 #1
Share this Question
2 Replies

 P: 2 Check out this one: Expand|Select|Wrap|Line Numbers   Dim myarray(3) As Integer         myarray(0) = 15         myarray(1) = 2         myarray(2) = 11         myarray(3) = 5         Array.Sort(myarray) it works perfect on my project Feb 17 '14 #2

 P: 2 also my opinion is to use list instead of array.. it has a lot more option to help you. here is the same example with a list: Expand|Select|Wrap|Line Numbers   Dim myList As New List(Of Integer)         myList.Add(15)         myList.Add(2)         myList.Add(11)         myList.Add(5)         myList.Sort() Feb 17 '14 #3

### Post your reply

Sign in to post your reply or Sign up for a free account.