OxL Справочник OxL
РусскийEnglish

method List.remove

Removes and returns the element at index i; later elements move one place down.

Example:

oxl✓ проверяется в CI
fn main() io {
  var xs = [10, 20, 30]
  let x = xs.remove(1)
  print("{x} {xs}")
}
Вывод
20 [10, 30]

Removes and returns the element at i. Panics when i is out of range.

Example:

oxl✓ проверяется в CI
fn main() io {
  var xs = ["a", "b", "c"]
  let b = xs.remove(1)
  print("{b} {xs}")
}
Вывод
b ["a", "c"]
pub(api) var fn remove(i: usize) -> T

Сложность. O(n) in the number of elements after `i`.

С версии. 1.0.0-beta

Параметры

ИмяТип
iusize

Возвращает

T

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/collections.oxl:241

См. также