我如何获得通用类型的正确名称?
例如:此代码
typeof(List<string>).Name
Run Code Online (Sandbox Code Playgroud)
返回
List`1
代替
List<string>
Run Code Online (Sandbox Code Playgroud)
typeof(List<string>).ToString()
Run Code Online (Sandbox Code Playgroud)
返回System.Collections.Generic.List`1 [System.String]但我想得到初始名称:
List<string>
Run Code Online (Sandbox Code Playgroud)
这是真的吗?
为什么new List<string>().ToString();返回以下内容:?
System.Collections.Generic.List`1[System.String]
Run Code Online (Sandbox Code Playgroud)
为什么它不会带回来System.Collections.Generic.List<System.String>.什么是奇怪的非C#语法?