Hi,
I have a param class containg these vars:-
string key; // eg: "WN"
object value; // eg: 1.2
string format; // eg "F2"
and I output these to a StreamWriter using
nc_file.Write("{0}{1:" + param.format + "}", param.key, param.value);
to give output like (using above egs) "WN1.20"
This works great for numeric types. Problem is that there are a couple
of string values which require padding - eg: "FN<some filename...."
which requires a fixed field size of say 20.
Is there a way to use a format string to achieve this - if there is I
haven't figured it. 99% of all parameters are string key/ numeric value
and I'm hoping I don't need to use special cases in the enumerator to
catch the few string values that need padding. Hopefully this makes sense.
Thanks for the help. matthew.