This documentation is archived and is not being maintained.

NameValueCollection.Remove Method

Removes the entries with the specified key from the NameObjectCollectionBase instance.

[Visual Basic]
Public Overridable Sub Remove( _
   ByVal name As String _
)
[C#]
public virtual void Remove(
 string name
);
[C++]
public: virtual void Remove(
 String* name
);
[JScript]
public function Remove(
   name : String
);

Parameters

name
The String key of the entry to remove. The key can be a null reference (Nothing in Visual Basic).

Exceptions

Exception Type Condition
NotSupportedException The collection is read-only.

Remarks

In collections of contiguous elements, such as lists, the elements that follow the removed element move up to occupy the vacated spot. If the collection is indexed, the indexes of the elements that are moved are also updated. This behavior does not apply to collections where elements are conceptually grouped into buckets, such as a hashtable.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

NameValueCollection Class | NameValueCollection Members | System.Collections.Specialized Namespace | Performing Culture-Insensitive String Operations

Show: