title: Comparing user input
body: <p>I want to write simple application in c# that help me learning touch typing. Right now I'm making method to compare chars from text and user input. I have problem because I made some method to look for text change : </p>
  
  <pre><code>private void tb_write_TextChanged(object sender, TextChangedEventArgs e)
      {
          TextBox t =(TextBox)sender;
  
          if (Words.WordCompare(tb_text.Text.ToCharArray(), t.Text.ToCharArray()))
          {
  
              l_words.Content =("OK");
  
  
          }
          else
          {
              l_words.Content = ("Not ok");
          }
  
      }
  </code></pre>
  
  <p>Then I have my WordCompare method:</p>
  
  <pre><code>class Words
  {
    public static bool WordCompare(char[] input, char[] output)
      {
          List&lt;char&gt; used = new List&lt;char&gt;();
  
          foreach(char ch_out in output)
          {
              foreach (char ch_in in input)
              {
                  if (ch_out == ch_in)
                  {
                      used.Add(ch_in);
                      return true;
                  }
              }
          }
          return false;
      }
  </code></pre>
  
  <p>Main problem is that if user input is ok (I mean that user write every character right) method works fine, but it checks only first character,no matter what I write then and always return true. Moreover it return true when any letter from text and user input is the same, no on what postion it is. I wanted to add "used" character to list to track them, but it makes new list every time when method is called. Could you help me with this problem, or maybe there is another way of solving it?</p>