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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Danatas GerviRank #4,152 · 361 reputationPosted Sep 15, 2009, 5:07 AM EDT
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);
Roei BarRank #1,271 · 1.4K reputationPosted Sep 14, 2009, 11:56 AM EDT
carle lai40 reputationPosted Sep 22, 2009, 9:39 PM EDT
{0} indicates that the first string after the first "," here it is "s"