title: Code returning false on equal compare?
body: <p>Problem I currently have:</p>
  
  <p>My server returns data back to the client, this includes a name. Now I want the client to grab this name and compare it. However for the past 3 hours I am stuck at this problem and I dont want to cheap fix around it.</p>
  
  <p>My server returns a value and then a name, ex: random23454@NAMEHERE</p>
  
  <p>I split the value using:</p>
  
  <pre><code>string[] values = returndata.Split('@');
  </code></pre>
  
  <p>And then I am doing: </p>
  
  <pre><code>if (textBox3.Text == values[1]) {
  MessageBox.Show("equal");
  }
  </code></pre>
  
  <p>However, the problem here is. I cant get it to be equal, I tried other methods but it just dont display equal.</p>
  
  <p>What I have done:</p>
  
  <p>Print textBox3.Text to a textbox and print values[1] to a other textbox and compared with my eye and mouse (Using invoke due to threading).</p>
  
  <p>Used the .Trim() function
  Using the .ToString() on values[1] (Just for the hell of it)
  Assigned them both to a complete new string, trimmed them and compared them</p>
  
  <p>Dragged the comparing outside the thread using:</p>
  
  <pre><code>this.Invoke((MethodInvoker)delegate()
                          {
                              outside(name);
                          });
  </code></pre>
  
  <p>and perform the same check.</p>
  
  <p>My code:</p>
  
  <pre><code> string returndata = System.Text.Encoding.ASCII.GetString(inStream);
                  readData = "" + returndata;
                  if (readData.Contains("@") &amp;&amp; readData.Contains("random"))
                  {
  
  
                      string[] values = returndata.Split('@');
                      string name = values[1].Trim();
  
                      if (textBox3.Text == name)
                      {
                          MessageBox.Show("true");
                      }
                      else
                      {
                          MessageBox.Show("false");
                          this.Invoke((MethodInvoker)delegate()
                          {
                              outside(name);
                          });
  
                      }
  </code></pre>
  
  <p>What else can I do? I just dont understand that it is not equal..</p>
  
  <p>Thanks in advance.</p>