List.ReplaceMatchingItems

语法

List.ReplaceMatchingItems(list as list, replacements as list, optional equationCriteria as any) as list

关于

对列表 list 执行给定的替换。 替换操作 replacements 由两个值(旧值和新值)组成,以列表形式提供。 可以指定可选相等条件值 equationCriteria 来控制相等测试。

示例 1

从 { 1, 2, 3, 4, 5 } 创建一个列表,将值 5 替换为 -5,将值 1 替换为 -1。

使用情况

List.ReplaceMatchingItems({ 1, 2, 3, 4, 5 }, { { 5, -5 }, { 1, -1 } })

输出

{ -1, 2, 3, 4, -5 }

results matching ""

    No results matching ""