Get type name without any generics info

后端 未结 3 2062
清酒与你
清酒与你 2021-01-07 17:25

If I write:

var type = typeof(List);
Console.WriteLine(type.Name);

It will write:

List`1

3条回答
  •  误落风尘
    2021-01-07 18:06

    No, it doesn't, because the "generic-type-string" is part of the name of type.

提交回复
热议问题