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)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.