📜  powershell 字符串替换 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:36.348000             🧑  作者: Mango

代码示例1
# Using the replace function (case sensitive)
$str = "Hello world!"
$str.replace("world", "Mars")
# Hello Mars!

# Using the replace operator (case insensitive, allows RegEx)
$str = "Hello world!"
$str -replace "world", "Earth"
# Hello Earth!