Zexor Well-known member Joined Nov 28, 2008 Messages 520 Programming Experience 3-5 Feb 1, 2010 #1 can i remove an item from the middle of a queue?
JohnH VB.NET Forum Moderator Staff member Joined Dec 17, 2005 Messages 15,874 Location Norway Programming Experience 10+ Feb 1, 2010 #2 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) Upvote 0 Downvote
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)