Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace лямбда3
- {
- class Program
- {
- delegate string Proccessor(string input);
- static void Main()
- {
- Proccessor[] proccessors =
- {
- (input) => input.ToLower(),
- (input) => input.Replace("dick", "****"),
- (input) => input.Replace(" ", "_")
- /*лямбда которая заменяет пробелы на нижнее подчёркивание*/
- };
- string text = Console.ReadLine();
- foreach(Proccessor i in proccessors)
- {
- text = i(text);
- }
- Console.WriteLine(text);
- Console.ReadKey();
- //прогонка текста через все лямбды и вывод итогового результата
- //на вводе "My dick is big" вывод "my_****_is_big"
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment