+ 2

C# {0}

I'm New In C# In Some Codes I Find {0} And {1} And I Really Don't Know What ThIs Mean So Can Someone Tell What That This Means ?

27th Jul 2020, 3:29 AM
Asem
4 Respuestas
+ 3
It is used when you want to format text. string msg="{0} my friends used to call me {1}{1} {2}"; Console.WriteLine(msg,"Hi","J","all the time"); Std output: "Hi my friends used to call me JJ all the time"
27th Jul 2020, 4:49 AM
David Rios
David Rios - avatar
+ 7
It is assigned to be the place holder of the some thing that have written before.
27th Jul 2020, 3:33 AM
Aphran Mohammed
Aphran Mohammed - avatar
+ 4
Can you provide an (example/sample code) to make your question more clear ?
27th Jul 2020, 4:13 AM
Arsenic
Arsenic - avatar
0
Thanks .
27th Jul 2020, 3:53 PM
Asem