You can use the closure mechanism and an anonymous function and you won't have to pass anything in as it will be visible to the anonymous function. See here:
public void Main
{
String[] names = new String[5]{"john","mary","peter","justin");
int length = 5;
String theone = Array.Find(names,delegate(String name)
{
return name.Length == length;
}
);
}
Array.Find takes an array and a bool delegate(String x) method. That means a method that takes exactly one String parameter and returns bool. You can also use the Generic form if you need to pass something other than a String. length will not have to be passed as a parameter since it is visible to the anonymous method.
Anymore questions? Leave a comment.
Cheers!