Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Delegate Array in C#
WhatsApp
Noor Mohamed
Jul 02
2015
5.2
k
0
0
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();
}
}
}
Array
C#
Delegate
Up Next
Delegate Array in C#