C#

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Wednesday, 10 December 2014

Reverse a string c# :- Interview Question

Question :)
Input String : I am he
Output String : he am I

using System;
using System.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string x = "I am he";

            var y = x.Split(' ');

            foreach (var z in y.Reverse())
            {
                Console.Write(z + " ");
            }
            Console.ReadLine();
        }
    }

}



No comments:

Post a Comment