title: A better way to replace many strings - obfuscation in C#
body: <p>I'm trying to obfuscate a large amount of data. I've created a list of words (tokens) which I want to replace and I am replacing the words one by one using the StringBuilder class, like so:</p>
  
  <pre><code> var sb = new StringBuilder(one_MB_string);
   foreach(var token in tokens)
   {
     sb.Replace(token, "new string");
   }
  </code></pre>
  
  <p>It's pretty slow! Are there any simple things that I can do to speed it up?</p>
  
  <p><b>tokens</b> is a list of about one thousand strings, each 5 to 15 characters in length.</p>