HttpHeaderValueCollection<T>.GetEnumerator Method

Definition

Returns an enumerator that iterates through the HttpHeaderValueCollection<T>.

public:
 virtual System::Collections::Generic::IEnumerator<T> ^ GetEnumerator();
public System.Collections.Generic.IEnumerator<T> GetEnumerator ();
abstract member GetEnumerator : unit -> System.Collections.Generic.IEnumerator<'T (requires 'T : null)>
override this.GetEnumerator : unit -> System.Collections.Generic.IEnumerator<'T (requires 'T : null)>
Public Iterator Overridable NotOverridable Function GetEnumerator () As IEnumerator(Of T)

Returns

An enumerator for the HttpHeaderValueCollection<T> instance.

Implements

Remarks

This enumerator returns the keys of the collection as strings.The foreach statement of the C# language (for each in Visual Basic) hides the complexity of the enumerators. Therefore, using foreach is recommended, instead of directly manipulating the enumerator.

Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

Initially, the enumerator is positioned before the first element in the collection.

Applies to