我怎样才能从这个简单的拆分中仅返回第二个数组元素:
$test="This,Home"
$test -split ","
返回值:
This
Home
我如何只返回“家”?
最佳答案
只需从列表中获取第二个元素(索引为1)
$test="This,Home"
($test -split ",")[1]
关于powershell - Powershell使用split只返回第n个元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42670288/