Lua: Finding a token in a delimited string
snippet in lua

Lua: Finding a token in a delimited string

user6833

local str = "foo;bar;baz;and;some;more;random;data;in;here"
function check(sString, sData)
  print( string.find(";"..sString..";", ";"..sData..";") )
end
check( str, "foo" )
check( str, "bar" )
check( str, "ba" )
check( str, "baz" )
check( str, "random" )
check( str, "stuff" )