ImmutableDictionary<TKey,TValue>.Builder.Remove 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Remove(KeyValuePair<TKey,TValue>) |
从不可变字典中删除特定对象的第一个匹配项。 |
| Remove(TKey) |
从不可变字典中删除具有指定键的元素。 |
Remove(KeyValuePair<TKey,TValue>)
从不可变字典中删除特定对象的第一个匹配项。
public:
virtual bool Remove(System::Collections::Generic::KeyValuePair<TKey, TValue> item);
public bool Remove(System.Collections.Generic.KeyValuePair<TKey,TValue> item);
abstract member Remove : System.Collections.Generic.KeyValuePair<'Key, 'Value> -> bool
override this.Remove : System.Collections.Generic.KeyValuePair<'Key, 'Value> -> bool
Public Function Remove (item As KeyValuePair(Of TKey, TValue)) As Boolean
参数
要从字典中删除的对象。
返回
true 如果 item 已成功从字典中删除,则为 ;否则为 false。 如果在 item 字典中找不到,此方法也会返回 false。
实现
例外
字典是只读的。
适用于
Remove(TKey)
从不可变字典中删除具有指定键的元素。
public:
virtual bool Remove(TKey key);
public bool Remove(TKey key);
abstract member Remove : 'Key -> bool
override this.Remove : 'Key -> bool
Public Function Remove (key As TKey) As Boolean
参数
- key
- TKey
要删除的元素的键。
返回
true 如果已成功删除元素,则为 ;否则,为 false. 如果字典中找不到此方法,此方法也会返回falsekey。
实现
例外
key 为 null。
字典是只读的。