Reputation: 22054
I am trying to write a number of values onto a line, like this...
try
{
sw.WriteLine("Element {0} {1} {2} {3} {4} {5} {6} (7} {8}",
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i");
}
catch (Exception ex)
{
string mystring = ex.ToString();
}
and getting an "Input string was not in a correct format" exception for my trouble. The streamwriter object exists and is valid as numerous other writes are performed before this one. (In the fullness of time I will replace the "a" etc with something more useful; as soon as I get this problem sorted out.)
Can anyone see what is wrong?
Upvotes: 1
Views: 1132
Reputation: 453
Look at "(7}". You need to replace the "(" with a "{".
Upvotes: 8