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

Re: zsh equivalent to string manipulation with offset and length



On Mon, Oct 20, 2008 at 12:06 PM, Dan Nelson <dnelson@xxxxxxxxxxxxxxx> wrote:
> In the last episode (Oct 20), Clint Adams said:
>> On Mon, Oct 20, 2008 at 01:15:06PM +0200, xulxer wrote:
>> > string="abcdefghijklmnopqrstuvwxyz"
>> > echo ${string:10:5}
>>
>> string="abcdefghijklmnopqrstuvwxyz"
>> print ${string[11,15]}
>
> , which matches the syntax for accessing array elements, and is much
> more readable than bash's syntax imho.
                                ^^^^^^^

bash's and ksh's syntax. Given this, it would be a nice feature to add
when the KSHARRAYS option is set.

>
> --
>        Dan Nelson
>        dnelson@xxxxxxxxxxxxxxx
>



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