Pavi S

Pavi S

  • NA
  • 41
  • 74.4k

How to arrange or grouping value in the list? in C#

Jan 30 2012 11:56 PM

i have sorted list like this(please refer below code)

code
======

var
sd = new SortedList<string, string>();
for (int p = 0; p < yearMatch.Count; p++)




{
sd.Add(YearAdded[p], Id[p]);
}
yearcount = sd.Keys.ToArray();
Id = sd.Values.ToArray();
=========================================
Example
===========
yearcount having year value 2000a,2000b,2000c,20003
Id having value 0020,0025,0030,0035
i want the output like this year value 2000a,b,c,2003
Id value 0020,0025,0030,0035
======================
if same year in the list i want to group that like above i said, i tried in many ways. please any one help guys.its imp and urgent.


 







Answers (6)