How to uniformly get part of string elements from array of strings

getindex.(z,Ref(1:2)) will work — you need to tell it not to broadcast over the 1:2 array.

6 Likes