【发布时间】:2012-04-26 20:35:03
【问题描述】:
如果在文本字符串中至少找到一次特定的匹配文本,我需要设置一个条件为真,例如:
str = "This is some text containing the word tiger."
if string.match(str, "tiger") then
print ("The word tiger was found.")
else
print ("The word tiger was not found.")
如何检查是否在字符串中的某处找到文本?
【问题讨论】:
标签: string lua conditional string-matching