/ Published in: Windows PowerShell

I needed to clean up strings with an unpredictable number of spaces interspersed throughout. Powershell's Replace method to the rescue.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$badString = "This is not the way it should be." $badString #for debug only while ($badString.Contains(" ")){ $badString = $badString -replace " "," " } $badString
Comments
