Last active
October 23, 2017 06:55
-
-
Save ZhangSen1/ee48638e2ec4a47da9af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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