Hi
How to loop thru groupeditems
C#
var groupedItems = objGroup.GroupBy(g => g.GroupName.Split('(')[0].Trim())
.Select(g => string.Join(" , ", g.Select(item => item.GroupName)));Thanks
Hi
How to loop thru groupeditems
var groupedItems = objGroup.GroupBy(g => g.GroupName.Split('(')[0].Trim())
.Select(g => string.Join(" , ", g.Select(item => item.GroupName)));Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Jun 13, 2023, 7:13 AM EDT
foreach (var item in groupedItems) { Console.WriteLine(item); }Brahma Prakash ShuklaRank #633 · 3.8K reputationPosted Jun 23, 2023, 1:54 AM EDT
var groupedItems = objGroup.GroupBy(g => g.GroupName.Split('(')[0].Trim())
.Select(g => string.Join(" , ", g.Select(item => item.GroupName)));
foreach (var group in groupedItems)
{
Console.WriteLine(group);
// Perform any operations or logic on each group
}