Adding a new List into Dictionary - Error

Hi All,

I’m practicing what the demo of the academy is teaching.
I am running into an issue where when trying to add new list into the Dictionary isn’t working. It throws out an error saying that an “)” is expected to which I’m unsure why and where to put the “)”

As reference: on the right side of the ss (demo), it can be seen that they are doing the same and that it works.

HI,

If you need to create instance of Dictionary<string, List<string>>. the following will help you.

New Dictionary(Of String,List(Of String))From{{"Key",New List(Of String)From{"Value1","Value2"}}}

Regards,

Hi Yoichi,

I use () instead of curly bracket {} that’s why it didn’t work.

Appreciate you pointing it out!

Cheers bud

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.