String.Format works fine with Debug.WriteLine if the variable does not have a string type:
int myNumber = 1; Debug.WriteLine("Put number here: {0}", myNumber);
Correct output with non-line
But if the variable is a string:
string myString = "ShouldWork"; Debug.WriteLine("Put text here: {0}", myString);
Invalid output with string
- ShouldWork: Put the text here: {0}
Why?
source share