What is the idiomatic way to slice an array relative to both of its ends?

前端 未结 7 1427
梦如初夏
梦如初夏 2021-02-06 20:35

Powershell\'s array notation has rather bizarre, albeit documented, behavior for slicing the end of arrays. This section from the official documentation sums up the bizarreness

相关标签:
7条回答
  • 2021-02-06 21:29

    Although not as neat as you might want but is cleaner in the way PowerShell works ...

    (@(1,2,3,4)) | Select-Object -Skip 1
    

    returns ...

    2
    3
    4
    
    0 讨论(0)
提交回复
热议问题