Answers for "c# linq sort list descending"

C#
0

order by length descending C#

string[] l_Data = { "1", "22", "333" };
l_Data = l_Data.OrderByDescending(x => x.Length).ToArray();
Console.WriteLine(l_Data);
Posted by: Guest on November-18-2020
-1

c# sort list

using System;

class Program
{
    static void Main()
    {
        string[] colors = new string[]
        {
            "orange",
            "blue",
            "yellow",
            "aqua",
            "red"
        };
        // Call Array.Sort method.
        Array.Sort(colors);
        foreach (string color in colors)
        {
            Console.WriteLine(color);
        }
    }
}
Posted by: Guest on March-23-2020

C# Answers by Framework

Browse Popular Code Answers by Language