What if I want to print "hello {0} world" ? With {0} printed as it is | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What if I want to print "hello {0} world" ? With {0} printed as it is

How can I do that? (won't it expect a variable argument at the end of the write method like console. Write("hello world {0}", something)

30th Sep 2016, 10:59 AM
Ryu
Ryu - avatar
2 Answers
+ 1
Console.WriteLine(@"Hello {0} world!");
30th Sep 2016, 1:09 PM
Andreas BeEm Kvist
Andreas BeEm Kvist - avatar
0
Or you can simply write : console.Write("hello world {{0}}", something)
29th Oct 2016, 6:09 PM
Sina M.Azad
Sina M.Azad - avatar