Removing characters that are uncommon in the comparison of two strings
<pre><code>string word1 = "misisipi";
string word2 = "mississippi";
</code></pre>

<p>I would like to 'compare' these strings some how and be able to 'toss out' letters that are not common.
For example word2 would be cut down to <code>"misisipi"</code>, making sure to keep the 'S'es in order, and <code>word1</code> would not change since all of its characters are in <code>word2</code>.  I recognize how to remove an element in a string, but this time I want to maintain the order.  For example, if I did <strong>not</strong> maintain the order, after comparison <code>word2</code> would be <code>"missipi"</code>, which is not what I want.</p>
