elena1234

ActionPrint- how to use action

Jan 25th, 2021 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace ActionPrint
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string[] names = Console.ReadLine().Split().ToArray();
  11.             Action<string[]> actionPrint= x => Console.WriteLine(string.Join(Environment.NewLine, x));
  12.             actionPrint(names);        
  13.         }
  14.     }
  15. }
  16.  
Add Comment
Please, Sign In to add comment