tshad <ts**********@ftsolutions.com> wrote:
Is there a way to do this in one line?
Well, you can use:
string s = DateTime.Parse(myDateString).ToString("MMddyy");
but do you really think that's clearer than splitting things into two
shorter lines?
What problem are you trying to avoid by doing as much as possible on
one line? Strictly speaking, you can do *almost* anything in a C#
program in one line (preprocessor directives and single line comments
are the exceptions, IIRC) but that doesn't mean it's a good idea.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too