lua-users home
lua-l archive

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


On Sat, Jan 24, 2009 at 4:56 PM, Vaughan McAlley <ockegheim@gmail.com> wrote:
> OK, so to fix this problem I need to tell it exactly how many results
> I want. My function:
>
> function f(s)
>    if string.byte(s) == 42 then
>        -- do stuff if and only if s starts with "*"
>    end
> end

Or

if string.find(s, "^*") then
  -- do stuff
end

Or

if s:find("^*") then
  -- do stuff
end

Sam