需要创建一个字典,其中键是list(Of String)或字符串数组
我发现这个链接C#列表作为字典键
但我需要帮助来了解如何使用list(的字符串)来做到这一点
Class test
Sub TryTest()
myDict.Add(New List(Of String) From {"Huey", "Dewey"}, actions.Sleeping)
myDict.Add(New List(Of String) From {"Dewey", "Louie"}, actions.Playing)
Dim newList As New List(Of String) From {"Dewey", "Louie"}
If myDict.ContainsKey(newList) Then
MsgBox("myDict contains the list of String, as Key Value")
Else
MsgBox("myDict don't contains the list of String, as Key Value")
End If
End Sub
Dim myDict As New Dictionary(Of List(Of String), actions)
End Class
Enum actions
Sleeping
Eating
Studying
Playing
End Enum
我期望包含键的字典输出。
P.S. 由于 c# 接近 vb.net,并且网络上有很多 c#/vb.net 翻译人员可以轻松翻译,拜托,也非常感谢 c# 的帮助。
互换的青春
精慕HU
相关分类