Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

VB: Deleting a key value when there is an array of values for a key?

$
0
0

I'm trying, with no success, to find and delete a value associated to a key when a key may contain more than one value. For example, when I built the key I did this:

        If oKey.ContainsKey(ListBox2.SelectedItem) Then
            oKey(ListBox2.SelectedItem).Add(ListBox1.SelectedItem)
        Else
            oKey.Add(ListBox2.SelectedItem, New List(Of String))
            oKey(ListBox2.SelectedItem).Add(ListBox1.SelectedItem)
        End If

So I may have something like this:

Key               |       Values

Folder1         |        File1, File2, File3

Folder2         |        File1

Folder3         |        File1, File2

I want to be able to delete the File2 from Folder1. Would anyone be able to jump start me in the right direction?


SV


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>