title: PowerShell TrimStart not always working
body: <p>I'm trying to trim the beginning of a string, but it doesn't always work correctly with <code>TrimStart()</code>. In the first example below it works fine, but in the second it doesn't.</p>
  
  <p><strong>Correct result:</strong></p>
  
  <pre><code>$Array = 'C:\Users\boblee\AppData\Local\Temp\2\Beez\ISO\ISO\Environnement',
  'C:\Users\boblee\AppData\Local\Temp\2\Beez\ISO',
  'C:\Users\boblee\AppData\Local\Temp\2\Beez\ISO\Achat'
  $Array | % {$_.TrimStart('C:\Users\boblee\AppData\Local\Temp\2')}
  </code></pre>
  
  <p><strong>Wrong result:</strong></p>
  
  <pre><code>$Array = 'S:\Test\Bob\Out_Test\Beez\ISO\ISO\Environnement',
  'S:\Test\Bob\Out_Test\Beez\ISO',
  'S:\Test\Bob\Out_Test\Beez\ISO\Achat'
  $Array | % {$_.TrimStart('S:\Test\Bob\Out_Test\')}
  </code></pre>
  
  <p>Can anyone help me out what the best way would be to trim of the beginning of the strings? </p>