Return to Snippet

Revision: 33862
at October 14, 2010 12:28 by stewshack


Initial Code
using System;
using System.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            // Reverse a string
            "Star Wars".ToCharArray().Reverse().ToList().ForEach(letter => Console.Write(letter));
        }
    }
}

Initial URL
http://weblogs.sqlteam.com/mladenp/archive/2006/03/19/9350.aspx

Initial Description
Here's how to reverse a string in one line using C# and LINQ.

Initial Title
Reverse a String with LINQ

Initial Tags

                                

Initial Language
C#