lua string index code example
Example 1: lua indexof
table.indexOf = function ( tab, value )
for index, val in ipairs(tab) do
if value == val then
return index
else
return -1
end
end
end
Example 2: Lua string
-- Strings are immutable. Immutable simply means unmodifiable or unchangeable.
a = 'this is a string'