Skip to main content

要素の削除.位置指定(delete-at,remove-at)

Python

py
del(items[n])

変な構文。

py
items = ['a', 'b', 'c', 'a', 'b', 'c']
del(items[3]) # ['a', 'b', 'c', 'b', 'c']

Swift

swift
lines.remove(at: 0)

JavaScript

js
item.splice(n, 1);

Ruby

rb
items.delete_at(n)