rawget()

类型 函数
(globals)
返回值 (多种)
修订版 2024.3703 版本
关键词 rawget, rawset, 表
另请参阅 rawset()

概述

获取 table[index] 的真实值,而不会调用任何元方法。table 必须为 index 可以为任何 数字字符串

语法

rawget( table, index )
table (必需)

任何表。

indexG2 (必需)

数字字符串 表中的索引(您想“获取”其真实值)。

示例

local t = {
    sample = "example value",
    another = 12345
}

print( rawget( t, "sample" ) )

-- OUTPUT: "example value"