共用方式為


List.ReplaceValue

語法

List.ReplaceValue(
    list as list,
    oldValue as any,
    newValue as any,
    replacer as function
) as list

關於

尋找值清單 list 中的值 oldValue,並將每次出現都用取代值 newValue 來替換。

範例 1

將清單 {"a", "B", "a", "a"} 中的所有 "a" 值以 "A" 取代。

使用方式

List.ReplaceValue({"a", "B", "a", "a"}, "a", "A", Replacer.ReplaceText)

輸出

{「A」、「B」、「A」、「A」}