My new favorite C# code snippet

My new favorite C# code:

string.Join(",", list.ConvertAll(x => x.ToShortTimeString()))

That takes a list of objects (DateTime in this example) and creates a comma-separated string of it. Short and sweet!

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: