When you need to create a method that handles an undefined number of parameters, one way to define it is by using an Array or list. Like this:
private void Method( string[] arguments )
{
//...
}
This, however, have a semantic inconvenience when called:
Method( new string[] { “a”, “b”, “c” };
To overcome this, use params before the string[] identifier, like this
private void Method( params string[] arguments )
{
//...
}
Now you can call the Method a bit cleaner, making your code more readable:
Method(“a”, ”b”, ”c”);