I am having some issues understanding HOF in C#. I want my DoSomething function to receive a function as a parameter that returns void and receives two strings. I cannot set the first generic parameter to void as the compiler complains. And this gives me an error.
Whats the right syntax to do this in C# ?
using System.IO;
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
DoSomething((v1, v2) => Console.WriteLine(v1, v2));
}
private static void DoSomething(Func<string,string,string> f){
f("1", "2");
}
}