Skip to content

Instantly share code, notes, and snippets.

@ZhangSen1
Last active October 23, 2017 06:55
Show Gist options
  • Save ZhangSen1/ee48638e2ec4a47da9af to your computer and use it in GitHub Desktop.
Save ZhangSen1/ee48638e2ec4a47da9af to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
public delegate TR MyDelegate<in T, out TR>(T t);
static void Main(string[] args)
{
MyDelegate<string, object> dd = new MyDelegate<object, string>(t =>
{
return t.ToString();
});
Console.WriteLine(Print(dd));
}
public static object Print(MyDelegate<string, object> myde)
{
return myde("123".Remove(0,1));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment