Here is a short example of how to use the Find method together with an anonymous delegate in C#.
(there are plenty of examples on the web but most forget to use an external variable)
var myExternalVariable = "Cool"; if you want to be even hairier, translate to lambda var possibleWord = list.Find(s => s == myVariable);
List
var possibleWord =
list.Find(delegate(string s)
{ return s == myExternalVariable; });
No comments:
Post a Comment