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?
Who is Participating?
Daniel Van Der WerkenConnect With a Mentor Independent ConsultantCommented:
Does this work for you?

        string[] list = new string[] { "one", "two", "three", "last" };
        string last = list.Last<string>();

Open in new window

r3nderAuthor Commented:
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>();
r3nderAuthor Commented:
got it
SVType = Program.myMainControl.dtoc.wordList.Last().thelabel;
                new_SVValue = Program.myMainControl.dtoc.wordList.Last().thevalue;
r3nderAuthor Commented:
Thanks when I saw what you wrote I figured it out.....:D
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.