Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Dictionary<string, /> mean?

Tags:

c#

dictionary

I ran across this construct in an online tutorial:

Dictionary<string, /> dictionary = new Dictionary<string, />();

I hadn't seen this syntax before and wasn't sure what it meant. I am not even certain that it is valid syntax at all as I can't get it to compile on my own.

like image 995
Matt Avatar asked Jul 16 '12 00:07

Matt


1 Answers

Matt, your intuition is right... it's not valid syntax. The forward slash character cannot be part of any valid type name.

After looking at the tutorial in question, and the way the dictionary is used, it looks like the definition should be Dictionary<string, object>. Perhaps some strange formatting bug occurred when the code was posted to CodeProject.

like image 152
Monroe Thomas Avatar answered Sep 23 '22 08:09

Monroe Thomas