lua-users home
lua-l archive

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


Lorenzo:
> Please, switch your mail client to plain text.

Sorry 'bout that.

> You could (should?) call it like that:
> local myDateTbl = myDateString:split("-")

Oh. Now I see why it didn’t work when I first tried it. I was trying to do myDateString.split("-"). I didn't see the :.

I'm noo(b).


Wesley:
> I think this function could be a lot simpler.  string.gmatch is more suited to this type of problem than string.find IMHO:
> ... gmatch(string.format("([^%s]+)%s?", delim, delim)) ...

I try to avoid regex's. Just because a block of code is shorter doesn't mean it’s simpler. I find them largely opaque to easy comprehension.


Thanks all. You guys are a big help to a Lua noob.


Dave