lua-users home
lua-l archive

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


> 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