MathTop

replace_at 函数

替换一基列表位置上的元素。

语法

  • replace_at(list, index, item)
  • ReplaceAt(list, index, item)

参数与选项

list形如 [1, 2, 3] 的列表字面量。
index要替换的一基位置。
item替换后的元素。

示例

  1. 替换元素replace_at([x, q, z], 2, y)返回 [x, y, z]。