New to Visual Studio and it's been 7 years since I've done any C#.
So the question I have is why bother with this format for a string output, what is going on with it and whats the benefit of it?
string tempValue = "Hello World";
Console.Write("Value of tempValue = {0}", tempValue);
Why would I use the above and not just call
string tempValue = "Hello World";
Console.Write("Value of tempValue = " + tempValue);
I'm looking for clarity as to why I would bother with the first code snippet.
No comments:
Post a Comment