Placing arguments in strings

PHOTO EMBED

Tue Jul 12 2022 14:58:30 GMT+0000 (Coordinated Universal Time)

Saved by @Marcos_ #c#

//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");
content_copyCOPY

https://code-maze.com/csharp-add-parameters-to-string/