Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Truncate strings in array



# sgniazdowski@xxxxxxxxx / 2016-05-22 09:20:10 +0200:
> having array of strings, is it possible to nicely truncate the strings
> to given length? Could iterate the array and do truncation, but maybe
> there's a one liner?

print -l ${strings/(#m)*/$MATCH[1,30]}

-- 
roman



Messages sorted by: Reverse Date, Date, Thread, Author