no9
no9

Reputation: 6544

How do I invoke a method with two arguments (where one of them is params)?

I have a newbie question: How do I invoke the following method:

public void Download(MyEnum aStrategy, params string [] strings)

I have tried:

Download(MyEnum.All, new string [] {"a", "b", "c"})

but have not had any success.

Upvotes: 0

Views: 103

Answers (1)

Tomas Jansson
Tomas Jansson

Reputation: 23472

Try:

Download(MyEnum.All, "a", "b", "c")

Your code should work to, but the above is "more correct".

Upvotes: 1

Related Questions