title: In C# how do you use placeholders in Console.WriteLine()?
body: <p>Am I using the <code>{0}</code> and <code>{1}</code> correctly in the code below for the name variable and age variable? What are the <code>{0}</code> and <code>{1}</code> called, are they formally called "placeholders"? Is it more preferable to use the + concatenation or the placeholder system to incorporate variables into <code>Console.Writeline()</code>?</p>
  
  <pre><code>Console.WriteLine("Hi " + nameInput + ", you are " + ageInteger + " years old.");
  Console.WriteLine("Hi {0}, you are {1} years old.", nameInput, ageInteger);
  </code></pre>
  
  <p>full code:</p>
  
  <pre><code>string nameInput;
  string ageInputString;
  int ageInteger;
  Console.WriteLine("Enter your name");
  nameInput = Console.ReadLine();
  Console.WriteLine("Enter your age");
  ageInputString = Console.ReadLine();
  Int32.TryParse(ageInputString, out ageInteger);
  Console.WriteLine("Hi " + nameInput + ", you are " + ageInteger + " years old.");
  Console.WriteLine("Press Enter to quit.");
  Console.ReadLine();
  </code></pre>