简体   繁体   中英

How can I view in VS2015 output window a List<string>?

I have been using this as a way to view output?

  Debug.WriteLine("abc");

Now I would like to sent the output of this:

  Debug.WriteLine(result.examples);

Where examples is a List

But I understand that Debug.Writeline accepts only a string

你可以使用string.Join形成, (或任何分隔符)分隔string

Debug.WriteLine(string.Join(",", result.examples));

尝试这个:

Debug.WriteLine(String.Join(Environment.NewLine, result.examples));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM