Python-like list unpacking in C#?
问题 In python, I can do something like this: List=[3, 4] def Add(x, y): return x + y Add(*List) #7 Is there any way to do this or something similar in C#? Basically I want to be able to pass a List of arguments to an arbitrary function, and have them applied as the function's parameters without manually unpacking the List and calling the function explicitly specifying the parameters. 回答1: Well, the closest would be reflection, but that is on the slow side... but look at MethodInfo.Invoke... 回答2: