I am stuck with a problem in Lua to check if a string value is indicated on another string.
As I will probably do this in Javascript:
'my string'.indexOf('no-cache') === -1 // true
but in Lua, I'm trying to use the string module, which gives me an unexpected answer:
string.find('my string', 'no-cache') -- nil, that fine but.. string.find('no-cache', 'no-cache') -- nil.. that weird string.find('no-cache', 'no') -- 1, 2 here it right.. strange..
string find lua indexof
Kosmetika
source share