Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Replace Multiple Words in String with PowerShell

$
0
0

Summary: Use Windows PowerShell to replace multiple words in a string.  

Hey, Scripting Guy! Question How can I use Windows PowerShell to replace misspelled words in a string?

Hey, Scripting Guy! Answer Use the –Replace operator, for example:

$s = "The calander says there are five calendar days left in the callander"

$s -replace "calander|callander","Calendar"


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>