title: Replacing characters but only if they comply the statement
body: <p>First of all, I have to tell this that I could find a better title but I just couldn't, just know that I at least tried. Anyways, I'm getting into the issue...</p>
  
  <p>So I have a string pretty much like this:</p>
  
  <pre><code>"&lt;aaa+aaa&lt;aaa+aaa&gt;&lt;aaa+aaa&gt;&gt;&lt;aaa+aaa&gt;"
  </code></pre>
  
  <p>I'm gonna replace "&lt;" to "{", ">" to "}" and "+" to "=." And this would make it like this:</p>
  
  <pre><code>"{aaa=aaa{aaa=aaa}{aaa=aaa}}{aaa=aaa}"
  </code></pre>
  
  <p>But I don't want like this one. I want something different which I can't even take it into words, sorry. But pretty sure you'll get when you see it. I want this:</p>
  
  <pre><code>"{aaa=aaa&lt;aaa+aaa&gt;&lt;aaa+aaa&gt;}{aaa=aaa}"
  </code></pre>
  
  <p>I'm new to C#. I've taken myself into this for hours, really. Even I've come so much closer to success, I still am missing something, therefore, it doesn't work.</p>
  
  <p>I could show my current code here but I think it is basically too long to share with you guys. Leastways, I can say that I used <code>String.Insert</code> and <code>String.Remove</code> in order to make that. However, it all started confusing and so I decided to tell my story to you.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>EDIT:</strong> Some of you wanted a better explanation and more examples. I'm gonna give a few more examples since I'm bad at another one.</p>
  
  <pre><code>"&lt;+&lt;+&gt;&gt;&lt;+&lt;+&gt;&lt;&gt;&gt;&lt;+&gt;&lt;+&lt;&lt;&gt;&gt;&gt;"
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>"{=&lt;+&gt;}{=&lt;+&gt;&lt;&gt;}{=}{=&lt;&lt;&gt;&gt;}"
  </code></pre>
  
  <p><strong>EDIT 2:</strong>
  A wonderful person named Lasse Vågsæther Karlsen helped me finding an explanation, thanks:</p>
  
  <blockquote>
    <p>I want top-level <code>&lt;</code> and <code>&gt;</code> to be replaced with <code>{</code> and <code>}</code>, but nested shouldn't, and <code>+</code> to <code>=</code> only immediately inside the top-level <code>&lt;</code> and <code>&gt;</code>, but not inside nested brackets.</p>
  </blockquote>