Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:core
  3. Map<K,V>
  4. remove abstract method
remove
description

remove abstract method

V?remove(
  1. Object?key
)

Removeskey and its associated value, if present, from the map.

Returns the value associated withkey before it was removed.Returnsnull ifkey was not in the map.

Note that some maps allownull as a value,so a returnednull value doesn't always mean that the key was absent.

final terrestrial = <int, String>{1: 'Mercury', 2: 'Venus', 3: 'Earth'};final removedValue = terrestrial.remove(2); // Venusprint(terrestrial); // {1: Mercury, 3: Earth}

Implementation

V? remove(Object? key);
  1. Dart
  2. dart:core
  3. Map<K,V>
  4. remove abstract method
Map class

[8]ページ先頭

©2009-2025 Movatter.jp