In a java forum, I have been (asked) by a java geek about
the variables arguments in C# saying that it is a nouveauty
in java 5 and it doesn't exist in C# syntax, I defy you if
you
provide me the equivalent of the under code:
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*/
It was a realy fun conversation