Guest User

Untitled

a guest
Aug 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. public delegate T Format<T>(T x);
  4.  
  5. public delegate int FormatNumber();
  6.  
  7. public delegate string FormatString(string x);
  8.  
  9. class MainClass {
  10.  
  11. static string name = "Kaca";
  12.  
  13. public static void Main (string[] args) {
  14.  
  15. // Format<string> f = x => x.ToUpper();
  16.  
  17. // Console.WriteLine ( f(name) );
  18.  
  19. Console.WriteLine
  20. (
  21. "Hello " + getName( x => x.ToUpper() )
  22. );
  23.  
  24. }
  25.  
  26. static string getName(FormatString format) {
  27. return format(name);
  28. }
  29.  
  30. }
Add Comment
Please, Sign In to add comment