【发布时间】:2017-08-22 01:21:05
【问题描述】:
这行得通:
$string = "This string, has a, lot, of commas in, it."
$string -replace ',',''
输出:这个字符串中有很多逗号。
但这不起作用:
$string = "This string. has a. lot. of dots in. it."
$string -replace '.',''
输出:空白。
为什么?
【问题讨论】:
-
它将其解析为正则表达式,afaik
.是任何字符的正则表达式
标签: powershell character-replacement