using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ArrayDelegates
{
public delegate string Delegatearray(string a);
class Delegate_Array
{
static string Str_Reverse(string x)
{
string S = new string(x.ToCharArray().Reverse().ToArray());
return S;
}
static string Str_Length(string x)
{
string S = Convert.ToString(x.Length);
return S;
}
static void Main(string[] args)
{
string call;
Delegatearray[] Darray = { new Delegatearray(Delegate_Array.Str_Reverse),
new Delegatearray(Delegate_Array.Str_Length) };
for (int i = 0; i < Darray.Length; i++)
{
call=Darray[i]("C-SHARP");
Console.WriteLine(call);
}
Console.ReadKey();
}
}
}Here you can learn about Delegate array with simple example.
