0
why in console.writeline sometime whe put "{0}" followed by a var.
console.writeline( "valor of x:{0}",X);
7 ответов
+ 5
{0}, {1}, {2} and so on are the position in the string where the variables, after comma, is placed in respective way.
For example,
console.writeline("I got {0} for Maths, {1} for English, and {2} for History", 80, 85, 75)
Try fiddling the numeric mark with A, A+, B, etc.
Do you get it?
0
It will refer to the first instance of the variable. Think of the comma delimited variables as an index. This way string expressions are greatly simplified.
0
can you explain mildly... your answer is too cumbersome
0
there are places holders for the variables .. those are for readable purpose..
- 1
yea now i get it thank u
- 1
{0} for telling the computer to print the first value of your data
- 1
it kind of output value of variables