Link to home
Start Free TrialLog in
Avatar of r3nder
r3nderFlag for United States of America

asked on

select last linq and lambda

I have a list that is populated continuously
I need to find the last entry and see if it is one of my strings
 Program.myMainControl.dtoc.wordList <- my list
var listofIns = new[]{ "AXGRMS","LATGRMS","AXSHK","LATSHK","AXROT","LATROT"}; <- what I am looking for


how do I  do that with linq?
ASKER CERTIFIED SOLUTION
Avatar of Daniel Van Der Werken
Daniel Van Der Werken
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of r3nder

ASKER

The list
var listofIns = new[]{ "AXGRMS","LATGRMS","AXSHK","LATSHK","AXROT","LATROT"};
are the strings I am looking for in the wordlist.thelabel
the struct is below for the wordlist

public struct datawords
        {
            public DateTime thetime { get; set; }
            public string thelabel { get; set; }
            public float thevalue { get; set; }
        }
public BindingList<datawords> wordList = new BindingList<datawords>();
Avatar of r3nder

ASKER

got it
SVType = Program.myMainControl.dtoc.wordList.Last().thelabel;
                new_SVValue = Program.myMainControl.dtoc.wordList.Last().thevalue;
Avatar of r3nder

ASKER

Thanks when I saw what you wrote I figured it out.....:D