Question regarding C#'s `List<>.ToString`

前端 未结 3 1419
滥情空心
滥情空心 2020-12-05 12:33

Why doesn\'t C# List<>\'s ToString method provide a sensible string representation that prints its contents? I get the class name (which I as

3条回答
  •  长情又很酷
    2020-12-05 13:13

    Because it's probably not that easy to implement.

    A List<> can contain a lot of stuff. For example another List<> that contains a Dictionary<> that contains complex objects...

提交回复
热议问题