[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Question about .substring

From: Tadziu Hoffmann
Subject: Re: [Groff] Question about .substring
Date: Thu, 20 Nov 2014 15:25:53 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

> second parameter that gives an empty string, unlike the
> [startindex, endindex) interval where endindex is exclusive,
> e.g. Python.

But that's not to say that the python way is in any way
more intuitive or useful.  Example:

    >>> print [1,2,3,4,5,6,7,8][-1] 
--> 8
    >>> print [1,2,3,4,5,6,7,8][-2:-1] 
--> [7]

which makes negative indices pretty useless for retrieving
a subrange that includes the last element...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]