title: How to compare 2 string arrays and find all consecutive matches and save indices?
body: <p>For example, if I have the following 2 arrays:</p>
  
  <pre><code>string[] userSelect = new string[] {"the", "quick", "brown", "dog", "jumps", "over"};
  string[] original = new string[] {"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"};
  </code></pre>
  
  <p>I'm trying to compare the userSelect array against the original array and get all consecutive matches based on index. The userSelect array will always be made up of strings from the original array. So the output would be like the following:</p>
  
  <pre><code>int[] match0 = new int[] {0, 1, 2}; // indices for "the quick brown"
  int[] match2 = new int[] {4, 5}; // indices for "jumps over"
  int[] match1 = new int[] {3}; // index for "dog"
  </code></pre>
  
  <p>The userSelect array length will never exceed the original array length, however it can be shorter and the words can be in any order. How would I go about doing this?</p>