0

Why do we have in output "Hello {0}..." what does {0} mean?

28th Nov 2017, 7:21 PM
RolsoN
RolsoN - avatar
5 ответов
+ 1
Thanks for helping me out :)
28th Nov 2017, 8:37 PM
RolsoN
RolsoN - avatar
0
{0} is a placeholder to make strings with embedded values more readable.
28th Nov 2017, 7:42 PM
Enrico Ludwig
Enrico Ludwig - avatar
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"
28th Nov 2017, 8:31 PM
Rabee Abbas
Rabee Abbas - avatar
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
28th Nov 2017, 8:35 PM
RolsoN
RolsoN - avatar
0
exactly
28th Nov 2017, 8:36 PM
Rabee Abbas
Rabee Abbas - avatar