doc_mmDelegate2.htm
 
Code :

using System;
using System.Collections;
//csc Indexer_string_to_int1.cs
namespace ConsoleApplication1
{
public delegate void Del(string message);
class MainClass
{
public static void Main(string[] args)
{
Del handler = DelegateMethod;
string msg;
Console.WriteLine("Hello World!");
msg = Console.ReadLine();
handler(msg);
Console.ReadLine();
}
// Create a method for a delegate.
public static void DelegateMethod(string message)
{
string str1;
str1 = "DelegateMethod(string message) started ";
str1 += message;
Console.WriteLine(str1);
}

}
}