Always more to learn


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am reviewing some samples for an
upcoming reference book. The samples are for classes I know very well. style="mso-spacerun: yes">  I designed or helped design most of
them.  But I always have something
to learn… Here is one that I thought was pretty cool… prints out the short day
names.. Culturelly relevant and all! "urn:schemas-microsoft-com:office:office" />


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">using style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
System;


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">using style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
System.Globalization;


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> 


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">namespace style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
Samples


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 1">      style="COLOR: blue">public class
DateTimeFormatInfoAbbreviatedDayNames


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 1">     
{


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 2">           
public style="COLOR: blue">static void
"urn:schemas-microsoft-com:office:smarttags" /> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">Main style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">()


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 2">           
{


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 3">                 
DateTimeFormatInfo f =
CultureInfo.CurrentCulture.DateTimeFormat;


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 3">                 
foreach ( style="COLOR: blue">string s in
f.AbbreviatedDayNames)


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 3">                 
{


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 4">                       
Console.WriteLine (s);


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 3">                 
}


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 2">           
}


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> style="mso-tab-count: 1">     
}


style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"> style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}


style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> 


style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">output:


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sun


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Mon


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Tue


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Wed


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thu


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Fri


style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sat


 

Comments (0)