Exemple #1
0
        static void Main(string[] args)
        {
            Play play = new Play(50);

            play.up1 += Display;
            play.up2 += Display1;
            play.At(10);
            play.At(10);
            play.Le(15);


            Upper upper = x => x.ToUpper();                                                                      //превращение в большие буквы

            Console.WriteLine(upper("превращение в большие буквы"));
            Lower lower = x => x.ToLower();                                         //ПРЕВРАЩЕНИЕ В МАЛЕНЬКИЕ БУКВЫ

            Console.WriteLine(lower("ПРЕВРАЩЕНИЕ В МАЛЕНЬКИЕ БУКВЫ"));
            DeleteProbel deleteProbel = delegate(string x)
            {
                return(x.Replace(" ", ""));
            };

            Console.WriteLine(deleteProbel("     Удаление    в  стр оке   пробелов"));                  //Удаление в строке пробелов
            DeleteZapatie deleteZapatie = x =>
            {
                return(Regex.Replace(x, "[-.?!)(,:]", ""));
            };                                                                                                                                                                                                  //......

            Console.WriteLine(deleteZapatie("Удаление,,!:? --знаков препинания!"));
            DobSim dobSim = x => x + " --- дополнительные символы --- !?-,,";

            Console.WriteLine(dobSim("Добавляем символы "));

            string s2 = "Привет,,,! меня     зовут и, вот! БОЛьшИе   бу   кВЫ!!!!";

            Action <string> action = x =>                                               //Action
            {
                x = upper(x);
                x = lower(x);
                x = deleteProbel(x);
                x = deleteZapatie(x);
                x = dobSim(x);
                Console.WriteLine(x);
            };

            action(s2);

            Console.ReadKey();
        }