What is generic delegate
What is generic delegate and how to use it.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Sep 21, 2012, 4:05 AM EDT
An example is the Func
Here's a simple example of using this generic delegate:
using System;
class Test
{
static void Main()
{
Func
string str = func(new char[]{'a', 'b', 'c'});
Console.WriteLine(str); // abc
Console.ReadKey();
}
static string CreateString(char[] chars)
{
return new string(chars);
}
}