
C#之冷门系列
C#不常用到的功能
秋雨雁南飞
这个作者很懒,什么都没留下…
展开
-
c#冷门系列之implicit和explicit
一、介绍今天刷博客看到implicit和explicit正好复习下知识点,写下该博客作为复习证据implicit用于隐式转换用户定义类型,explicit显示转换用户定义类型,好了废话不多说,直接上代码,一瞧便知创建实体Student public class Student { public int Id { get; set; } public string Name { get; set; } public int Age {原创 2020-11-19 22:45:27 · 1017 阅读 · 0 评论 -
C#冷门系列之string.Compare
介绍:string.Comparestring.Compare方法,用来比较2个字符串的大小,还可忽略大小写使用:string.Compare(str1, str2, true);1 : str1大于str20 : str1等于str2-1 : str1小于str2示例:string.Compare("Name","name",StringComparison...原创 2020-05-05 18:03:26 · 2151 阅读 · 0 评论 -
C#冷门系列之SortedDictionary、SortedList
介绍:SortedDictionary<key,value>,从字面意思不难看出来是有序字典SortedList<key,value>,有序集合使用://SortedDictionary SortedDictionary<int, string> sortDic = new SortedDictionary<int...原创 2020-05-01 11:24:57 · 1440 阅读 · 0 评论 -
C#冷门系列之Lazy
概述:泛型Lazy<T>,延迟加载对象,线程安全,.NET4.0+使用:插件模拟数据:public static List<Student> GetList() { return new List<Student> { new Student {Id =...原创 2020-05-01 09:46:15 · 1081 阅读 · 0 评论 -
C#冷门系列之Join
1.需求:public static List<string> GetList() { return new List<string> { "咖啡", "啤酒", "牛奶", ...原创 2020-04-25 13:40:30 · 454 阅读 · 0 评论 -
C#冷门系列之Select、Zip
1.需求: 咖啡 啤酒 牛奶 豆浆将上面文本加上索引列,如下所示 1:咖啡 2:啤酒 3:牛奶 4:豆浆创建模拟数据:public static List<string> GetList() { ret...原创 2020-04-25 11:39:41 · 255 阅读 · 0 评论 -
C#冷门系列之ToLookup
1.首先我们有这样一个学生实体,学生与课程是一对多关系 public class Student { /// <summary> /// Id /// </summary> public string Id { get; set; } /// <summary&...原创 2020-04-25 11:00:04 · 822 阅读 · 0 评论