hello friends i have a small doubt.
in " Console.WriteLine("Hello,{0}", s);" what does {0} indicate ??
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Danatas GerviPosted Sep 15, 2009, 9:07 AM
Roei is right.
One more example:
string name = "John";
string surname = "Silver";
string helloString = "Hello, {0} {1} !";
Console.WriteLine(helloString, name, surname);
Console.WriteLine(helloString, surname, name);
carle laiPosted Sep 23, 2009, 1:39 AM
{0} indicates that the first string after the first "," here it is "s"
Roei BarPosted Sep 14, 2009, 3:56 PM