LINQ: Remove first entry of groups in a list
-
Try:
var x = list.GroupBy(g => g.Key).Select(grp => grp.Skip(1)).SelectMany(i => i);
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
You're welcome!
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Try:
var x = list.GroupBy(g => g.Key).Select(grp => grp.Skip(1)).SelectMany(i => i);
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
You need a small tweak to get a one-off instance like 'baz in the result:
var x = list.GroupBy(g => g.Key).Select(grp =>
grp.Count() == 1
? grp
: grp.Skip(1)).SelectMany(i => i);«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
-
You need a small tweak to get a one-off instance like 'baz in the result:
var x = list.GroupBy(g => g.Key).Select(grp =>
grp.Count() == 1
? grp
: grp.Skip(1)).SelectMany(i => i);«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
Yes, but his original question specifically excluded "baz".
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Yes, but his original question specifically excluded "baz".
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
I tear my hair out, throw myself at your lotus feet, and beg mercy while singing [^] :omg: I'm such a sucker for a stray 'baz :wtf: Been a very weird day !
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
-
I tear my hair out, throw myself at your lotus feet, and beg mercy while singing [^] :omg: I'm such a sucker for a stray 'baz :wtf: Been a very weird day !
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
Never any need for that Bill - you are Forgiven[^] of course. (And I love Sharon's voice)
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
I tear my hair out, throw myself at your lotus feet, and beg mercy while singing [^] :omg: I'm such a sucker for a stray 'baz :wtf: Been a very weird day !
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
Please stop singing immediately. this is supposed to be a serious forum. ;P
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
Please stop singing immediately. this is supposed to be a serious forum. ;P
Luc Pattyn [My Articles] Nil Volentibus Arduum
Okay, got it ... I'm switching to screaming :wtf:
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
-
Okay, got it ... I'm switching to screaming :wtf:
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
That would be fine in Q&A :cool:
Luc Pattyn [My Articles] Nil Volentibus Arduum
-
Never any need for that Bill - you are Forgiven[^] of course. (And I love Sharon's voice)
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
lovely voice, reminds me a little of Sarah Brightman. thanks, Bill
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
-
That would be fine in Q&A :cool:
Luc Pattyn [My Articles] Nil Volentibus Arduum
Only when I have finished banging my head on the desk.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Only when I have finished banging my head on the desk.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
Are you at it again, wasn't this stretch day for you? :confused:
Luc Pattyn [My Articles] Nil Volentibus Arduum