title: vb.net string - replace placeholder tokens efficiently
body: <p>I'm just looking for some ideas with a little problem. I've a string that's a template for a message, for example:</p>
  
  <pre><code>Dear [[Guest.FirstName]],
  
  We hope your are looking forward to your holiday in [[Booking.ResortName]]
  </code></pre>
  
  <p>My current system for replacing the spaceholder tokens (e.g. [[Guest.FirstName]]) is very inefficient, there's loops inside loops and it takes for too long.</p>
  
  <p>What I'm looking for is a way that would go through the string until it finds [[something]], then replace that [[something]] with it's real value, then continue on through the string.</p>
  
  <p>Please note to replace [[something]] then I need to have access to the space holder (i.e. i need to know if it's [[Guest.FirstName]] or [[Booking.ResortName]]).</p>
  
  <p>Any suggestions for an efficient way to achieve this would be very much appreciated, I feel it should be fairly straightforward but everything I can think of ends up with loops inside loops again.</p>
  
  <p>Thanks!</p>
  
  <p>Phil.</p>