CollectionExtensions 类

定义

为泛型集合提供扩展方法。

public ref class CollectionExtensions abstract sealed
public static class CollectionExtensions
type CollectionExtensions = class
Public Module CollectionExtensions
继承
CollectionExtensions

方法

名称 说明
GetValueOrDefault<TKey,TValue>(IReadOnlyDictionary<TKey,TValue>, TKey, TValue)

尝试获取与 key 指定的 dictionary值关联的值。

GetValueOrDefault<TKey,TValue>(IReadOnlyDictionary<TKey,TValue>, TKey)

尝试获取与 key 指定的 dictionary值关联的值。

Remove<TKey,TValue>(IDictionary<TKey,TValue>, TKey, TValue)

尝试从中删除具有指定keydictionary值的值。

TryAdd<TKey,TValue>(IDictionary<TKey,TValue>, TKey, TValue)

尝试添加指定keyvalue添加到 。dictionary

适用于