小编Eth*_*tin的帖子

检查数组是否包含特定值

我有这个数组,有一些值(int),我想检查用户给出的值是否等于该字符串中的值.如果是,则输出"Got your string"之类的消息.

列表示例:

local op = {
{19},
{18},
{17}
}

if 13 == (the values from that array) then
  message
else
  other message
Run Code Online (Sandbox Code Playgroud)

如何才能做到这一点?

lua lua-table

14
推荐指数
3
解决办法
5万
查看次数

标签 统计

lua ×1

lua-table ×1