lua-users home
lua-l archive

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


On 15 June 2013 03:22,  <meino.cramer@gmx.de> wrote:
> Hi,
>
> is there a way to remove leading and trailing whitespace (inluding \n
> or \r ) from a string with lua without using lpeg or loading a C-Lib
> for regexp?
>
> Thank you very much in advance for any help!
> Best regards,
> mcc
>

somestring = somestring:match("^%s*(.+)%s*$")