String.Format works fine with Debug.WriteLine if variable not of string type:
int myNumber = 1;
Debug.WriteLine("Put number here: {0}", myNumber);
Correct Output with Non-String
- Put number here: 1
But if variable is string:
string myString = "ShouldWork";
Debug.WriteLine("Put text here: {0}", myString);
Incorrect Output with String
- ShouldWork: Put text here: {0}
You are getting the wrong overload…
You could work around that:
A good wrapper would be