Reversing a string without creating extra memory
<p>I have a string which is of about 1mb size. The requirement is to reverse the string without allocating another temp string of size 1 MB. I tried the following code</p>

<pre><code>string name = "abcde";

string target = "";
for(int i = name.Length - 1; i &gt;=0; i--)
{
    target += name[i];
    name = name.Remove(i);                
    int n = name.Length;
}
</code></pre>

<p>but my friend says  if we use the function <code>name.Remove(i)</code> it will return a new string but it is not guaranteed that the old string will be deleted from memory and so there is no guarantee that the size will be reduced. is it true? if so is there any other option available to reverse a string without allocating extra memory?</p>
