Esempio n. 1
0
        public static void ReverseString()
        {
            Console.WriteLine("Input word to reverse:");
            var input = Console.ReadLine();

            Console.WriteLine(StringsAndArray.ReverseArray(input));
        }
Esempio n. 2
0
        public static void ReverseStringOfWords()
        {
            string output = StringsAndArray.ReverseWords(new char[] { 't', 'h', 'e', ' ', 'e', 'a', 'g', 'l', 'e', ' ',
                                                                      'h', 'a', 's', ' ', 'l', 'a', 'n', 'd', 'e', 'd' }, true);

            Console.WriteLine(output);
            Console.WriteLine();

            string output1 = StringsAndArray.ReverseWords(new char[] { 't', 'h', 'e', ' ', 'e', 'a', 'g', 'l', 'e', ' ',
                                                                       'h', 'a', 's', ' ', 'l', 'a', 'n', 'd', 'e', 'd' }, false);

            Console.WriteLine(output1);
            Console.WriteLine();
        }