Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
Learn how to simply remove a string from another string!
May 21, 2017
For more technical explainers on PowerShell, read our updated 2021 report: PowerShell 101: A Technical Explainer for IT Pros.
Q. How can I easily remove a string of text in PowerShell?
A. A simple way to remove a string from a string is to search for the string to be replaced and substitute with a blank string. For example to remove LAB I could use:
$LabShortName = $Lab.Name.Replace("LAB","")
You May Also Like