Lua 如何检查(&x2B;X)是否为最后一个文本
我有以下代码:Lua 如何检查(&x2B;X)是否为最后一个文本,lua,Lua,我有以下代码: local text = 'CIA' if text == text..'+X' then print 'true' else print 'false' end 我想检查最后一个文本是否以(“+X”)结尾。函数提取一个子字符串。负指数从头到尾 if string.sub(text, -2) == '+X' then -- Ends with +X, do stuff accordingly. end 该函数提取一个子字符串。负指数从头到尾 if s
local text = 'CIA'
if text == text..'+X' then
print 'true'
else
print 'false'
end
我想检查最后一个文本是否以(“+X”)结尾。函数提取一个子字符串。负指数从头到尾
if string.sub(text, -2) == '+X' then
-- Ends with +X, do stuff accordingly.
end
该函数提取一个子字符串。负指数从头到尾
if string.sub(text, -2) == '+X' then
-- Ends with +X, do stuff accordingly.
end
我要检查最后一个文本是否以('+X')结尾。我要检查最后一个文本是否以('+X')结尾。