I m curious why would i use string formatting while i can use concatenation such as
Console.WriteLine(\"Hello {0} !\", name); Console.WriteLine(\"Hello \"+
String formatting allows you to keep the format string separate, and use it where it's needed properly without having to worry about concatenation.
string greeting = "Hello {0}!"; Console.WriteLine(greeting, name);
As for why you would use it in the exact example you gave... force of habit, really.