How do I apply a sequence of insert/delete-character operations on a string?
<p>I have a text like this:</p>

<blockquote>
  <p>My name is Bob and I live in America.</p>
</blockquote>

<p>I have some reference to the characters of this string, for example:</p>

<pre><code>from 3 to 7 chars, deleted
at 3 char, added "surname"
from 20 to 25, deleted
at 25 char ....
</code></pre>

<p>but these statements aren't ordered (and I can't order them).</p>

<p>So, this is the question: how can I modify the text without losing the reference of the characters?
For example, if I apply the first sentence, my text became:</p>

<blockquote>
  <p>My is Bob and I live in America.</p>
</blockquote>

<p>and my third sentence doesn't work correctly anymore, cause I've lost the reference to the original 20th character.</p>

<p>Keep in mind that the text is pretty long, so I can't use any indexes...</p>
