title: Remove non matching number from two arrays
body: <p>I have a <code>foreach</code> that loops over two <code>arrays</code> to check if the numbers are matching and in the same order as each other.</p>
  
  <p>However one of the <code>arrays</code> can have some extra numbers that I want to remove/ignore before comparing.</p>
  
  <p>Example:</p>
  
  <pre><code>int[] currentTracingPoints = new int[] { 1,2,3,4 };
  int[] part = new int[] {1,2,3};
  </code></pre>
  
  <p>I would like to remove the number 4 from <code>currentTracingPoints</code></p>
  
  <p>Example:</p>
  
  <pre><code>int[] currentTracingPoints = new int[] {4,5,6,8};
  int[] part = new int[] {4,5,8};
  </code></pre>
  
  <p>I would like to remove the number 6 from <code>currentTracingPoints</code></p>
  
  <p>I am using Unity</p>
  
  <pre class="lang-cs prettyprint-override"><code>foreach (TracingPart part in tracingParts) { // check tracing parts
      if (currentTracingPoints.Count == part.order.Length &amp;&amp; !part.succeded) {
          // check whether the previous tracing parts are succeeded
          if (PreviousLettersPartsSucceeded (part, tracingParts)) {
              equivfound = true; // assume true
              for (int i = 0; i &lt; currentTracingPoints.Count; i++) {
                  int index = (int) currentTracingPoints [i];
                  if (index != part.order [i]) {
                      equivfound = false;
                      break;
                  }
              }
          }
      }
  }
  </code></pre>