Code and Christmas :-)

Private card As Func(Of DateTime, String) =


Function(x As DateTime) If(x = New DateTime(DateTime.Now.Year, 12, 24), “Merry Christmas”,


                        If(x = New DateTime(DateTime.Now.Year, 12, 31), “Happy New Year”,


                        “No Card for today”))


 


Func<DateTime, string> card = (DateTime x) =>


         x == new DateTime(DateTime.Now.Year, 12, 24) ? “Merry Christmas” :


         x == new DateTime(DateTime.Now.Year, 12, 31) ? “Happy New Year” :


         “No Card for today”;


 


Merry Christmas to everybody!
PepLluis,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>