Declare and Instantiate List(Of KeyValuePair(Of String, String))

  • Thread starter Thread starter Ste Wilko
  • Start date Start date
S

Ste Wilko

Guest
I am trying to code my own Enigma machine for no reason other than I watched a video on how they work and now I'm intrigued.


I'm trying to make an emulation of the wiring of the rotors and the best thing to do looks like the List(Of KeyValuePair(Of String, String)). I know how to add to it, but I just want to fill it during the declaration instead, as the values won't ever change

Now I know how to do it with a simple list, for example

Code:
Public wiring as New List(Of String) ({"A", "B"})

But if I do it like that for KeyValuePair it throws an error

Code:
Public wiring as New List(Of KeyValuePair(Of String, String)) ({"A","B"})

I get an "Overload resolution failed because no accessible 'New' accepts this number of arguments"

How do I do it?

Continue reading...
 
Back
Top