Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# sort array string by length

public static string[] SortLength(string[] arr)
        {
            string[] sorted = arr
                .OrderBy(x => x.Length) //.OrderByDescending
                .ToArray();

            return sorted;
        }
 
PREVIOUS NEXT
Tagged: #sort #array #string #length
ADD COMMENT
Topic
Name
7+5 =