I want to sort records based on their integer value in descending order:
Example:
name1, 4 name2, 6 name3, 3 name4, 5
Should be re - arranged to this:
name2, 6 name4, 5 name1, 4 name3, 3
I've tried using the Array.Sort but I could not get it working.
As always I appreciate all of your help.
You can split the data into two arrays and use use
array.sort
to sort based on the integers.This will sort both arrays in ascending order of
ia
. Iterate the arrays backward to get descending order.