placeholder | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

placeholder

When I use {1} or another numbers to replace {0}, it doesn't work. Must it begin with {0}?

22nd Aug 2016, 12:54 AM
Terry Chu
Terry Chu - avatar
3 Answers
+ 3
Yes, they must start with 0. It's as if you're inserting data to an Array that's why first data must be saved to index0 and so on.
22nd Aug 2016, 11:37 AM
Erwin Mesias
Erwin Mesias - avatar
+ 1
Yes it must, as 0 means first, 1 means second....etc, for example Age = 35 Console.WriteLine(''You are {0} years old, Age); 0 is the first number in programing, as you may notice in the previous simple piece of code, it states the Age varible to be 35 (((of course this piece of code doesn't actually work since it states an int figure without configuring (Read the chapter right befor Comments in the first class for more info))) and it later reclaims Age as 0, if you have added more varibles you can use as many as you desire, for example.. 1 = A 2 = B 3 = C Console.WriteLine(''{0} {1} {2}'', 1, 2, 3); I suposd this code works and should output A B C if it doesn't well then sorry but you get the point anyway, thanks for reading :)
22nd Aug 2016, 2:00 AM
Khaled Moharram
Khaled Moharram - avatar
+ 1
Yes, it should always start with {0}
22nd Aug 2016, 6:55 PM
Taras