Question Queue

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
can i remove an item from the middle of a queue?
 
Convert it to a regular list (ToList), remove the item, add the list to a new queue.
VB.NET:
Dim q As New Queue(Of String)
q.Enqueue("it1")
q.Enqueue("it2")
q.Enqueue("it3")
Dim l = q.ToList
l.RemoveAt(1)
q = New Queue(Of String)(l)
 
Back
Top