更新时间:2023-08-26 20:40:40
Instead of a for loop you could also use the Foreach-Object cmdlet (if you prefer using the pipeline):
Foreach-Object
$str = "apple","lemon","toast" $str = $str | ForEach-Object {"Week$_"}
Output:
Weekapple Weeklemon Weektoast
将字符串附加到数组的每个项目
将字符串附加到 Matlab 数组
迭代范围,将字符串附加到每个
添加preFIX到PHP数组的每一个项目