title: Selection Sorting String Arrays (Java)
body: <p>I need to know how to sort an array of Strings, I know how to do a selection sort, however I have BOTH numbers and letters in the array. The idea is to sort a hand of cards. 
  This is what I have ... </p>
  
  <pre><code>clubsArry[0] = 7C
  
  clubsArry[1] = AC
  
  clubsArry[2] = TC
  
  clubsArry[3] = KC
  </code></pre>
  
  <p>The second character represents the suit of the card, in this case clubs, and the first character is the card value (the T represents Ten, K is king, A is ace, etc.), so for the clubsArry[0] , the card is a 7 of clubs. When I sort it and print, the output I get is ....</p>
  
  <pre><code>7C
  
  AC
  
  KC
  
  TC
  </code></pre>
  
  <p>So all the cards that that have a letter in the first position get sorted properly but I still have the 7 of clubs that is at the top of the output. The output that I want is ...</p>
  
  <pre><code>AC
  
  KC
  
  TC
  
  7C
  </code></pre>
  
  <p>The way I tried to sort it was by doing this:</p>
  
  <pre><code>public void sortClubs() // A selection sort, that will sort out the clubs 
  {
      for (int i = 1; i &lt; clubsArry.length; i++)
      {
          int s = i-1;
          for (int j = i; j &lt; clubsArry.length; j++)
          {
              if (clubsArry[j].compareTo(clubsArry[s]) &lt; 0)
              {
                   s = j;
              }
          }
           String temp = clubsArry[i-1];
           clubsArry[i-1] = clubsArry[s];
           clubsArry[s] = temp;
      }
  }
  </code></pre>
  
  <p>I just cant seem to figure it out, I was going to convert it into a char array and then cast into an int and the sort and convert it all back, but I figure there must be a simpler way to do this, If there is a way at all.</p>
  
  <p>Thanks for all the help :) </p>
  
  <p>MadcapClover</p>