title: how do you reverse a string in C# using LINQ?
body: <p>I was reading an old post from coding horror (<a href="http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html" rel="nofollow noreferrer">http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html</a>) It's still a very entertaining read, you'll notice a lot of the people providing answers actually made small logical errors themselves (about 30% of them).</p>
  
  <p>Anyway, thought I'll set myself a small challenge and found a bunch of fizzbuzz questions here: <a href="https://stackoverflow.com/questions/117812/alternate-fizzbuzz-questions">Alternate FizzBuzz Questions</a></p>
  
  <p>"Reverse a String" - with all the built-in methods in the .net framework there are many ways to do this. </p>
  
  <p>My question is:
  1. <strong>how do you reverse a string using LINQ?</strong> 
  2. can you come up with other interesting ways of reversing a string in C#?</p>
  
  <p>Here's are two examples I came up with 
  1. completely from scratch
  2. using enumerable's reverse methods (1 liner)</p>
  
  <pre><code>    private static string FromScratchSimplified(string input)
      {
          // constructed reversed char array
          char[] reversedCharArray = new char[input.Length];
          for (int i = 0; i &lt; input.Length; i++)
          {
              reversedCharArray[i] = input[input.Length-1-i];
          }
  
          // build string from char array
          string reversedString = new String(reversedCharArray);
  
          return reversedString;
      }
  
  
      private static string UsingEnumerableReverseMethod(string input)
      {
          // using Enumerable.Reverse method
          return new String(input.Reverse().ToArray());
      }
  </code></pre>
  
  <p>Any more?</p>