using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            //以下为Char
            char ch1 = ‘,‘;
            Console.WriteLine(Char.IsSeparator(ch1));
            char ch2 = ‘ ‘;
            Console.WriteLine(Char.IsWhiteSpace(ch2));
            Console.WriteLine(ch1.CompareTo(‘a‘));
            string str1;
            str1 = Char.ConvertFromUtf32(ch1);
            Console.WriteLine(str1);
            Console.WriteLine(Char.Equals(ch1, ch2));
            Console.WriteLine(ch1.GetTypeCode());
            char ch3 = ‘\a‘;
            Console.WriteLine(Char.IsControl(ch3));
            Console.WriteLine();
            //以下为DateTime
            DateTime dt1 = new DateTime(2018, 01, 04, 11, 20, 00);
            DateTime dt2 = new DateTime(2018, 07, 04, 14, 20, 00);
            Console.WriteLine(dt1.Date);//输出当前时间精确到日期,不涉及几点几分几秒
            Console.WriteLine(dt1.DayOfWeek);//输出当前时间是这一周的第几天
            Console.WriteLine(dt1.DayOfYear);//输出当前时间是这一年的第几天
            Console.WriteLine(dt1.Hour);//输出当前时间的点数
            Console.WriteLine(System.DateTime.Now);//输出当前时间,精确到秒
            Console.WriteLine(System.DateTime.DaysInMonth(1998,2));//输出在指定的年月中这个月有多少天
            Console.WriteLine(DateTime.Now.Add(new TimeSpan(1008601, 0, 0)));//输出指定时间间隔后的时间,时间间隔格式为时分秒
            Console.WriteLine(DateTime.Parse("2018/01/04 11:20:00"));//输出由字符串转换成的时间
            Console.WriteLine(dt1.ToLongDateString()+" "+dt1.ToLongTimeString());//输出dt1的时间,精确到秒
            Console.WriteLine(dt1.ToShortDateString() + " " + dt1.ToShortTimeString());//输出dt1的时间,精确到分
            TimeSpan ts1 = dt1-dt2;//设置一个时间间隔并输出
            Console.WriteLine(ts1);
            Console.WriteLine(System.DateTime.Now + ts1);//输出 当前时间加上一个特定的时间间隔后得到的时间
            Console.WriteLine(ts1.Days+" "+ts1.Hours+" "+ts1.TotalDays);//间隔取整天、小时数对24取余、以天为单位的数
            Console.WriteLine();
            //以下为转义字符
            Console.WriteLine("衣阿华\‘级"+" "+"密苏里\"号"+" "+"MK7\\406毫米舰炮");
            Console.WriteLine("\‘hello\‘");
            Console.WriteLine("‘hello‘");
            Console.WriteLine(@"‘hello‘");
            Console.WriteLine();
            //以下为引用类型
            string str2 = "伊丽莎白女王级战列舰";
            string str3 = str2;
            Console.WriteLine("str2:"+str2+" "+"str3:"+str3);
            str2 = "沙恩霍斯特级战列舰";
            Console.WriteLine("str2:" + str2 + " " + "str3:" + str3);
            Console.Read();
        }
    }
}