Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Replace special character in powershell

$
0
0

PowerShell’s -replace operator uses regular expressions, and also works well on collections. If your $c variable happens to just be a single string (not a collection of strings), though, you can also just use the Replace() method of the String class, which keeps regex out of the picture:

$c = $c.Replace('\\filedep\iservershare\DCSVWA', '\\EGSISFS01\VolksWagon\DCSVWA')

Viewing all articles
Browse latest Browse all 13067

Trending Articles