Does the term callback in the context of delegates mean ,"a delegate delegating it works to another delegate inorder to finish some task" ?
Example :(Based on my understanding,I have implemented a callback,correct me if it is wrong)
namespace Test
{
public delegate string CallbackDemo(string str);
class Program
{
static void Main(string[] args)
{
CallbackDemo handler = new CallbackDemo(StrAnother);
string substr= Strfunc(handler);
Console.WriteLine(substr);
Console.ReadKey(true);
}
static string Strfunc(CallbackDemo callback)
{
return callback("Hello World");
}
static string StrAnother(string str)
{
return str.Substring(1, 3).ToString();
}
}
}
Please provide examples as necessary.