Advertisement
gabi11

Functional Programming - 02. Knights of Honor

May 26th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6.  
  7.  
  8. namespace CSharpAdvanced
  9. {
  10.  
  11.     class Program
  12.     {
  13.         static void Main(string[] args)
  14.         {
  15.             Action<string> printAction = name => Console.WriteLine($"Sir {name}");
  16.  
  17.             Console.ReadLine()
  18.                 .Split(" ", StringSplitOptions.RemoveEmptyEntries)
  19.                 .ToList()
  20.                 .ForEach(printAction);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement