摘要:
class Program { static void Main(string[] args) { string aa = "test"; Console.WriteLine(aa.ExtrString()); Console.Read(); } } public static class testExtraFunc //需要是静态类 { //给密封类String增加扩展方法 public static string ExtrString(this string str) //需要是静态方法 { return str + "这是扩展方法"; } }
阅读全文
摘要:
发现有很多基础知识没有掌握或者不熟练,最近想系统的看一遍,顺便整理读书笔记。 class Program { static void Main(string[] args) { var array = new List() { 1, 2, 3, 4, 5, 6, 7 }; var d1 = new Predicate(More); Console.WriteLine("more"); Print(array, d1); var del...
阅读全文