/ Published in: C#
Here's how to reverse a string in one line using C# and LINQ.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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)); } } }
URL: http://weblogs.sqlteam.com/mladenp/archive/2006/03/19/9350.aspx