开发者

IndexOf predicate?

开发者 https://www.devze.com 2023-02-03 20:49 出处:网络
I want to find the index of an element in a list maching a certain predicate, is there a better way to do it than:

I want to find the index of an element in a list maching a certain predicate, is there a better way to do it than:

var index = list.IndexOf(list.Find(predicate)开发者_运维技巧);

?


Are you looking for List<T>.FindIndex(predicate)?

0

精彩评论

暂无评论...
验证码 换一张
取 消