This is a discussion on How can you sort the elements of the array in descending order In C#. NET 2005? within the C# Programming forums, part of the Software Development category; How can you sort the elements of the array in descending order In C#. NET 2005?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| We can sort the arrays by using Array.Sort() method and we can inverse it by using the Array.Reverse() method. Here is the code to do the job. string[] myValues = { "strawberries", "PEARS", "LIMES", "BERRIES", "grapes", "olives", "cantaloupe" }; Array.Sort(myValues); Array.Reverse(myValues); |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to sort object array? | raja | C# Programming | 4 | 03-14-2008 09:52 PM |
| Selecting data's by order | S.Vinothkumar | Database Support | 3 | 09-27-2007 03:12 AM |
| Duplicate elements from an array | vigneshgets | C and C++ Programming | 1 | 09-06-2007 08:04 AM |
| What are order of precedence and associativity, and how are they used? | anbuchezhians | Java Programming | 1 | 08-01-2007 11:53 PM |
| How to sort the datagrid columns in ascending order and decending order using c# dot? | Archer | C# Programming | 1 | 07-22-2007 11:28 PM |