//Placing an argument in a string
Console.WriteLine($"Hi, my name is {name}. I am {age} years old");
//Using an inline terciary in a string
Console.WriteLine($"Hi, my name is {name}. I am {age} year{(age == 1 ? "" : "s")} old");
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter