Grouping List by the last Char
Question
alt text http://barbarosalp.com/questions/list.png
Hi,
As you can see on the picture above i have a List "keys" filled with Request.Form.AllKeys which a key starts with "txt".
I want to group them by their last id, for example
[0] "txtTitle:2" "txtDescription:2"
[1] "txtTitle:3" "txtDescription:3"
How can i achive this with lambda expression.
Thank you very much
Solution
var groups = keys.GroupBy(e=>e.Split(':').Last());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow