How To Remove Characters from a String Using PowerShell

In this blog post, I will show you how to remove a number of characters from a string using PowerShell.

Substring

In the following code, I will use a PowerShell method called substring, which takes a string and remove a number of characters we defined in the method as you will see below.

The code below has a  variable $string with the value “ntweekly.com”, I will use the method and remove the first 8 characters from the sting.

$String = 'NTweekly.com' 
$String.Substring(8)

Processing…
Success! You're on the list.

Posted

in

by