public void Method(String ... Numbers)
{
for(String s : Numbers)
{
System.out.println(s); }
}
The method is called as follow
Method("1","2","3");
I said OK, what about this code?
public void Method(params string[] Numbers)
{
foreach (string s in Numbers)
{ MessageBox.Show(s);
}
}
To call the method proceed like this amigo, recall that this old technique exists even within C# 2.0 - 2005
Method("1", "2", "3", "I'm here", ": )"/*<-this is me*/);/*<-this is you*/

Join the conversation! Your thoughts help the community grow.