SortedSet<T>.Remove(T) 方法

定义

SortedSet<T> 中移除指定的项。Removes a specified item from the SortedSet<T>.

public:
 virtual bool Remove(T item);
public bool Remove (T item);
abstract member Remove : 'T -> bool
override this.Remove : 'T -> bool
Public Function Remove (item As T) As Boolean

参数

item
T

要移除的元素。The element to remove.

返回

Boolean

如果成功找到并移除该元素,则为 true;否则为 falsetrue if the element is found and successfully removed; otherwise, false.

实现

注解

如果 SortedSet<T> 对象不包含指定的元素,则对象将保持不变,并且不会引发异常。If the SortedSet<T> object does not contain the specified element, the object remains unchanged and no exception is thrown.

itemnull 用于引用类型。item can be null for reference types.

此方法是一种 O(log n) 操作。This method is an O(log n) operation.

适用于