title: Sort a list alphabetically
body: <p>I have the following class:</p>
  
  <pre><code>class Detail
  {
      public Detail()
      {
          _details = new List&lt;string&gt;();
      }
      public IList&lt;string&gt; Details { get { return _details; } }
      private readonly List&lt;string&gt; _details;
  }
  </code></pre>
  
  <p>Currently I sort the class randomly using the following:</p>
  
  <pre><code>void ShuffleGenericList&lt;T&gt;(IList&lt;T&gt; list)
  {
      //generate a Random instance
      var rnd = new Random();
      //get the count of items in the list
      var i = list.Count();
      //do we have a reference type or a value type
      T val = default(T);
  
      //we will loop through the list backwards
      while (i &gt;= 1)
      {
          //decrement our counter
          i--;
          //grab the next random item from the list
          var nextIndex = rnd.Next(i, list.Count());
          val = list[nextIndex];
          //start swapping values
          list[nextIndex] = list[i];
          list[i] = val;
      }
  }
  </code></pre>
  
  <p>What I would like to do is to sort the contents of details in alphabetic order.</p>
  
  <p>So for example if the contents look like this:</p>
  
  <pre><code>[0] a
  [1] d
  [2] b
  </code></pre>
  
  <p>I want to be able to run this method and have them sorted into:</p>
  
  <pre><code>[0] a
  [1] b
  [2] d
  </code></pre>
  
  <p>Does anyone know of a simple way to do this? Note that the lists usually have less than ten entries in them. Can I do this with LINQ? Sorry but I am not very familiar with LINQ I have just heard a suggestion that I could use that.</p>