List.FirstList.First
構文Syntax
List.First(list as list, optional defaultValue as any) as any
バージョン情報About
リスト list
内の最初の項目を返します。リストが空の場合は、省略可能な既定値 defaultValue
を返します。Returns the first item in the list list
, or the optional default value, defaultValue
, if the list is empty. リストが空で、既定値が指定されていない場合、関数は null
を返します。If the list is empty and a default value is not specified, the function returns null
.
例 1Example 1
リスト {1, 2, 3} 内の最初の値を求めます。Find the first value in the list {1, 2, 3}.
List.First({1, 2, 3})
1
例 2Example 2
リスト {} 内の最初の値を求めます。Find the first value in the list {}. リストが空である場合は、-1 を返します。If the list is empty, return -1.
List.First({}, -1)
-1