Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# group array based on first character

Select().GroupBy(x => x.Name.Substring(0,1).ToUpper(), 
        (alphabet, subList) => new { 
          Alphabet = alphabet, 
          SubList = subList.OrderBy(x => x.Name).ToList() 
        }).OrderBy(x => x.Alphabet);
 
PREVIOUS NEXT
Tagged: #group #array #based #character
ADD COMMENT
Topic
Name
1+1 =