title: Converting strings to int in C#
body: <p>im pretty new to C# and i want to make a cardgame. What i have is a list of cards (strings) with names like <code>c6, s3, h11, d13</code> where the <code>character represents the colour</code> and the <code>number represents the value</code>. When pressing a button the program takes a random string from the list and displays it in a textbox. From there the point of the game is to guess if the next random card will have a higher value or a lower value then the previous card.</p>
  
  <p>What i want to do is to take the string from the textbox and turn it into a int so that i can compare the value of the previous card with the new one. Only problem is how do i get rid of the <code>c</code> in <code>c6</code> so i can convert it by using <code>parse</code>.</p>
  
  <p>This is my code.</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      static Random rndmlist = new Random();
      Random rndm = new Random();
      List&lt;string&gt; deck = new List&lt;string&gt;();
      int score = 0;
      public MainWindow()
      {
          InitializeComponent();
      }
  
      private void test_Click(object sender, RoutedEventArgs e)
      {
          //disregard this
          foreach (string j in deck)
          {
              testbox.Text += j + ", ";
          }
      }
  
      private void btnstart_Click(object sender, RoutedEventArgs e)
      {
          //this is where i add all the cards to the list
          for (int i = 1; i &lt;= 13;)
          {
              deck.Add("c" + i);
              i++;
          }
          for (int i = 1; i &lt;= 13; )
          {
              deck.Add("s" + i);
              i++;
          }
          for (int i = 1; i &lt;= 13; )
          {
              deck.Add("h" + i);
              i++;
          }
          for (int i = 1; i &lt;= 13; )
          {
              deck.Add("d" + i);
              i++;
          }
      }
  
      private void btnbegin_Click(object sender, RoutedEventArgs e)
      {
          //this is where i take a random card from the list and display it in textBox2
          int r = rndmlist.Next(deck.Count);
          textBox2.Text = ((string)deck[r]);
  
          //disregard this
          testbox.Text += ((string)deck[r]) + ", ";
          deck.Remove((string)deck[r]);
      }
  
      private void btnhigh_Click(object sender, RoutedEventArgs e)
      {
          //this is where i want to compare the cards.
      }
  }
  </code></pre>
  
  <p>Thank you in advance for reading this. (:</p>