📅  最后修改于: 2022-03-11 14:51:36.348000             🧑  作者: Mango
# 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!