lua-users home
lua-l archive

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


It was thus said that the Great Soni L. once stated:
> 
> 
> On 24/09/15 12:39 PM, Dirk Laurie wrote:
> >Consider the following code:
> >
> >local trim_pattern = "^%s*(.*%S)%s*$"
> >
> Wouldn't it be faster if you trimmed at start, reversed, then trimmed at 
> start again? (or maybe at start, then at end?)

  I think the fastest was is mentioned in this posting back in 2009:

http://lua-users.org/lists/lua-l/2009-12/msg00951.html 

but you can check the entire thread starting from:

http://lua-users.org/lists/lua-l/2009-12/msg00877.html

  -spc (I'll take Past Topics for $200, Alex!)