Syntax
List.First(list as list, optional defaultValue as any) as any
About
如果列表为空,defaultValue则返回列表中的list第一项或可选的默认值。 如果列表为空且未指定默认值,则函数返回 null。
示例 1
在列表 {1, 2, 3} 中找到第一个值。
用法
List.First({1, 2, 3})
输出
1
示例 2
在列表中 {}查找第一个值。 如果列表为空,则返回 -1。
用法
List.First({}, -1)
输出
-1