lua-users home
lua-l archive

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


On Thu, 2011-02-24 at 16:56 -0300, Luiz Henrique de Figueiredo wrote:
> for w in (os.getenv("PATH")..":"):gmatch(".-:") do print(w) end

for w in (os.getenv("PATH")):gmatch("[^:]+") do print(w) end

avoids the : at the end of path names (and the need to stick an
additional : at the end)

</nk>