Summary: Use Windows PowerShell to replace non-alphabetic characters in a string.
How can I use Windows PowerShell to replace a string that contains non-alphabetic characters
(such as commas and periods)?
Use the –Replace operator, and specify a regex pattern ‘[^a-zA-Z]’, for example:
$a = ‘Never a foot too far, even.’
$a -Replace ‘[^a-zA-Z]’,”
0 comments