lua-users home
lua-l archive

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


On Mon, Dec 1, 2014 at 1:52 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> Or just this:
>
> function b(s)
>         return tonumber(s:gsub("[^%d]",""),2)
> end


right! i was digging the ones i actually use, and found my override to
tonumber that accepts '0b' in addition to '0x'.  and of course with a
:gsub('[^%w]','') to remove weird things...

-- 
Javier