[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Most efficient way to recognize a line by its first (up to) three characters
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 11 Mar 2014 15:34:26 -0300
> But how can I handle different length of prefixes with directly
> following data... ?
Just change the logic to extract the prefixes. Perhaps something like this:
local h = handlers[line:sub(1,1)]
or handlers[line:sub(1,2)]
or handlers[line:sub(1,3)]
or badprefix