I have a list of paths (filtered by special criteria). I want to mutate each entry in this list, but can't find a way (I think it's immutable). What's th开发者_StackOverflow社区e best way of going about this?
Thanks
I guess you have some collection, not only list (probably array).
PS> $myList = 'first','second','third'
You can mutate the collection by indexing or just by creating new array like this:
PS> $myList[1] = '2nd'
#or
PS> $myList | % { $_.Substring(0,2) }
fi
se
th
精彩评论