【发布时间】:2020-09-30 13:29:05
【问题描述】:
所以我在 lua 中有一个类似这样的列表
hello
hello1
hello2
我想看看x 字符串是否在我的列表中。
我知道如何在 python 中做到这一点,但我完全不知道如何在 lua 中做到这一点(有点紧凑?)
在python中:
list = ["hello1", "hello2", "hello3"]
if "hello1" in list:
print("this worked!")
else:
print("this didn't")
【问题讨论】:
-
这能回答你的问题吗? Search for an item in a Lua list
标签: lua