In the function Test(Func<string,bool> f), how to call f.invoke(开发者_如何学编程)? I received the error
Delegate 'Func' does not take '0' arguments
bool b = f(someString);
or:
bool b = f.Invoke(someString);
The delegate Func<string, bool> is a delegate that takes a string as an argument and returns bool. To invoke it, you need to supply a string.
e.g., either should work
f("foo");
f.Invoke("foo");
加载中,请稍侯......
精彩评论