The code below works in the
lua demo, but doesn't work in Luan (for luan, replace 'string' with 'String').
function endsWith(s,p)
return string.sub(s, -string.len(p)) == p
end
a = '1234567890'
print(endsWith(a, '890')) -- true
print(endsWith(a, '7890')) -- true
print(endsWith(a, '1890')) -- false
print(endsWith(a, '111111111111111111')) -- false