跳至主要内容

coalescelist 函数

coalescelist 接受任意数量的列表参数,并返回第一个非空的列表。

示例

代码块
> coalescelist(["a", "b"], ["c", "d"])
[
"a",
"b",
]
> coalescelist([], ["c", "d"])
[
"c",
"d",
]

要使用列表的列表执行 coalescelist 操作,请使用 ... 符号将外部列表展开为参数

代码块
> coalescelist([[], ["c", "d"]]...)
[
"c",
"d",
]
  • coalesce 对字符串参数执行类似的操作,而不是列表参数。