Hi VRSki,
Thank you for the feedback.
I am not sure if Arnshea's link meets your need. This link talks about the
"Composite Formatting" feature of .Net Framework. However, I suspect you
may want to understand why we can use variable in the String.Format()
method like the code Arnshea provided in the first reply.
Regarding this point, let's explain it briefly. As documented in MSDN, the
first parameter of String.Format() method is a string, so we only need to
construct a string for the first parameter. We may programmatically
construct the string by concatenating multiple sub-string together into a
format string. That's what "|{0:" + paddingLength + "}|" does. Note: in
this statement, the C# operator "+" is predefined for numeric and string
types. When one or both operands are of type string, "+" concatenates the
string representations of the operands. So the net result is a format
string which can be passed to the first parameter of String.Format. The
link below talks about the C# "+" operator:
"+ Operator (C# Reference)"
http://msdn2.microsoft.com/en-us/library/k1a63xkz(VS.80).aspx
Anyway, if your concern relies on the "Composite Formatting" feature of
String.Format, Arnshea's link should be a good explanation. Thanks.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.