title: How do I delete spaces from a string?
body: <p>I want to delete spaces from a string value. For example, <code>sString := 'Hello my name is Bob</code> should become <code>sString := 'HellomynameisBob</code>.</p>
  
  <p>I tried using the while loop:</p>
  
  <pre><code>iPos := pos(' ', sString);
  while iPos &gt; 0 do
  Delete(sString,iPos,1);
  </code></pre>
  
  <p>but the program just freezes.</p>