Articles → CSHARP → Action Delegate In C#
Action Delegate In C#
Purpose
Example
using System;
public class Program
{
static void Main(string[] args)
{
Action<string> printActDel = ActionDelegateDemo;
printActDel("World");
Console.ReadLine();
}
public static void ActionDelegateDemo(string name)
{
Console.WriteLine(String.Format("Hello {0}", name));
}
}
Output
Click to Enlarge