Basic LINQ expression for an ItemCollection

前端 未结 2 1744
盖世英雄少女心
盖世英雄少女心 2021-02-05 00:20

I have an ItemCollection that I\'d like to query using LINQ. I tried the following (contrived) example:

var lItem =
    from item in lListBox.Items
    where Str         


        
2条回答
  •  渐次进展
    2021-02-05 00:42

    You need to specify the type of "item"

    var lItem =
        from object item in lListBox.Items
        where String.Compare(item.ToString(), "abc") == true
        select item;
    

提交回复
热议问题