标签:style blog color os for cti
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.IO; namespace LambdaExpressionAction { class Program { static void Main(string[] args) { //定义输出委托 Action<double> print = amount => Console.WriteLine("{0:c}", amount); //定义新委托并引用上面的输出委托 Action<double> michiganSalesTax = amount => print(amount *= 1.06); //定义一个数组 var amounts = new double[] { 10.36, 12.00, 134 }; //泛型方法Array>ForEach在amounts中进行迭代并调用michiganSalesTax Array.ForEach<double>(amounts, michiganSalesTax); Console.ReadLine(); } } }
LinQ 泛型方法Array>ForEach在数组中进行迭代并调用自定义的委托,布布扣,bubuko.com
LinQ 泛型方法Array>ForEach在数组中进行迭代并调用自定义的委托
标签:style blog color os for cti
原文地址:http://www.cnblogs.com/swtool/p/3840751.html