跳转到内容

removeindex

<type> removeindex(<type>&array[], int index)

array中移除指定index处的元素并返回其值。这与pop(array, index)功能相同,但名称更清晰易懂。

负索引表示从数组末尾开始计数,因此removeindex(array, -2)会移除倒数第二个元素。

int  removeindex(dict &dictionary, string index)

dictionary中移除指定index的字典条目。

如果该条目不存在则返回0,如果成功移除则返回1