Click here to Skip to main content
15,894,646 members
Home / Discussions / C#
   

C#

 
QuestionHow to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 1:42
Member 1305673426-Sep-19 1:42 
AnswerRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 2:02
mveRichard Deeming26-Sep-19 2:02 
GeneralRe: How to press a key with TranslateMessage Pin
Member 1305673426-Sep-19 2:10
Member 1305673426-Sep-19 2:10 
GeneralRe: How to press a key with TranslateMessage Pin
Richard Deeming26-Sep-19 2:14
mveRichard Deeming26-Sep-19 2:14 
AnswerRe: How to press a key with TranslateMessage Pin
OriginalGriff26-Sep-19 2:23
mveOriginalGriff26-Sep-19 2:23 
QuestionChanging many projects from AnyCPU to x64 Pin
Bernhard Hiller24-Sep-19 22:04
Bernhard Hiller24-Sep-19 22:04 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
OriginalGriff24-Sep-19 22:29
mveOriginalGriff24-Sep-19 22:29 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
harold aptroot24-Sep-19 23:33
harold aptroot24-Sep-19 23:33 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller25-Sep-19 0:11
Bernhard Hiller25-Sep-19 0:11 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
jkirkerx25-Sep-19 13:47
professionaljkirkerx25-Sep-19 13:47 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
Richard MacCutchan25-Sep-19 21:43
mveRichard MacCutchan25-Sep-19 21:43 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller26-Sep-19 21:43
Bernhard Hiller26-Sep-19 21:43 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
harold aptroot27-Sep-19 23:35
harold aptroot27-Sep-19 23:35 
GeneralRe: Changing many projects from AnyCPU to x64 Pin
Bernhard Hiller29-Sep-19 21:48
Bernhard Hiller29-Sep-19 21:48 
AnswerRe: Changing many projects from AnyCPU to x64 Pin
AntGamble15-Oct-19 21:40
AntGamble15-Oct-19 21:40 
QuestionHow to properly close a JSON Post using RestSharp? Pin
mlong3024-Sep-19 13:25
mlong3024-Sep-19 13:25 
AnswerRe: How to properly close a JSON Post using RestSharp? Pin
BillWoodruff24-Sep-19 16:06
professionalBillWoodruff24-Sep-19 16:06 
QuestionLINQ: Remove first entry of groups in a list Pin
Mc_Topaz23-Sep-19 3:20
Mc_Topaz23-Sep-19 3:20 
Well ,that title is confusing... Poke tongue | ;-P

I have this list:
C#
var list = new List<(int Key, string Value)>();
list.Add((1, "foo1"));
list.Add((1, "foo2"));
list.Add((1, "foo3"));
list.Add((1, "foo4"));
list.Add((2, "bar1"));
list.Add((2, "bar2"));
list.Add((2, "bar3"));
list.Add((2, "bar4"));
list.Add((3, "baz"));
From that list I want a new list:
C#
(1, "foo2")
(1, "foo3")
(1, "foo4")
(2, "bar2")
(2, "bar3")
(2, "bar4")

Notcie the first occurances of any "key/group" are removed in the result list.
These entries are removed: (1, "foo1"), (2, "bar1") and (3, "baz")

I have no clue how to do this. I have tried to create a solution, but I don't know how to find the first entry of a group and remove it using LINQ. The .Distinct() and .First() methods seems needed in someway, but I cannot figure it out. I'm sure I can hack something ugly with foreach loops and new lists, but I would prefer a solution with LINQ.

Any suggestions for a solution?
Best regards
AnswerRe: LINQ: Remove first entry of groups in a list Pin
OriginalGriff23-Sep-19 4:31
mveOriginalGriff23-Sep-19 4:31 
GeneralRe: LINQ: Remove first entry of groups in a list Pin
Mc_Topaz23-Sep-19 4:49
Mc_Topaz23-Sep-19 4:49 
GeneralRe: LINQ: Remove first entry of groups in a list Pin
OriginalGriff23-Sep-19 4:51
mveOriginalGriff23-Sep-19 4:51 
GeneralRe: LINQ: Remove first entry of groups in a list Pin
BillWoodruff23-Sep-19 5:47
professionalBillWoodruff23-Sep-19 5:47 
GeneralRe: LINQ: Remove first entry of groups in a list Pin
OriginalGriff23-Sep-19 5:50
mveOriginalGriff23-Sep-19 5:50 
GeneralRe: LINQ: Remove first entry of groups in a list Pin
BillWoodruff23-Sep-19 5:55
professionalBillWoodruff23-Sep-19 5:55 
GeneralRe: LINQ: Remove first entry of groups in a list Pin
OriginalGriff23-Sep-19 6:11
mveOriginalGriff23-Sep-19 6:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.