lua-users home
lua-l archive

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

On Tue, Jan 27, 2009 at 2:56 AM, Vaughan McAlley <> wrote:
> If you're just testing a single character at the start, comparing to
> string.sub(s,1,1) - or s:sub(1,1) - seems like a more obvious route to take.
> -Duncan

My original intention was to test the string without creating a new
string. Pretty trivial, I know, in the grand scheme of things :-)


Ah right. (You're not quite creating a new string - strings with the same value only exist once in Lua - but there's probably slight overhead, sure.)