public void DoSomething(params string[] theStrings)
{
foreach(string s in theStrings)
{
// Something with the Strings…
}
}Called like
DoSomething(“The”, “cat”, “sat”, “on”, “the” ,”mat”);
How about the params keyword i.e.
public void DoSomething(params string[] theStrings)
{
foreach(string s in theStrings)
{
// Something with the Strings…
}
}
public void DoSomething(params string[] theStrings)
{
foreach(string s in theStrings)
{
// Something with the Strings…
}
}
Called like
DoSomething(“The”, “cat”, “sat”, “on”, “the” ,”mat”);