[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string:sub
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 8 Mar 2010 21:20:18 -0300
> This is a strange point of view, for me. I mean it's fully correct,
> sure, but when do we need to express an empty (sub)string (or any kind
> of sequence) using literal indexes?
They do not need to be literals. (1,0) is the result of string.find
when it finds an empty string in the beginning of a string:
print(string.find("a", "%d*")) --> 1 0
string.find must be able to express that result, and so string.sub should
accept that too.
-- Roberto
- References:
- Re: string:sub, David Burgess
- Re: string:sub, Enrico Colombini
- Re: string:sub, spir
- Re: string:sub, Scott Vokes
- Re: string:sub, joao lobato
- Re: string:sub, Shmuel Zeigerman
- Re: string:sub, Roberto Ierusalimschy
- Re: string:sub, joao lobato
- Re: string:sub, Roberto Ierusalimschy
- Re: string:sub, spir