0
Why do we have in output "Hello {0}..." what does {0} mean?
5 odpowiedzi
+ 1
Thanks for helping me out :)
0
{0} is a placeholder to make strings with embedded values more readable.
0
int i =22;
Console.WriteLine("hello {0}",i);
the second line can be read this way:
put the value of I (22) in the place of {0}
output: "hello 22"
0
So when:
int i=34
int y=35
Console.WriteLine("Numbers are: {0} {1}", i, y);
It should look like this:
Numbers are 34 35
0
exactly