.NET Interactive-如何更改收集输出大小

发布于 2025-01-23 07:05:59 字数 293 浏览 1 评论 0原文

我正在使用.NET Interactive Notebook内部VS代码,并想更改打印的元素数:

var x = Enumerable.Range(0,21);
x.Display();

输出中仅显示了前20个元素:

”在此处输入图像描述

我可以以某种方式增加输出的大小吗?

I'm using .NET Interactive notebook inside VS Code and want to change the number of printed out elements:

var x = Enumerable.Range(0,21);
x.Display();

Only first 20 element are shown in the the output:

enter image description here

Can I somehow increase the size of output?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难忘№最初的完美 2025-01-30 07:05:59

您可以从Microsoft.dotnet.intractive.formatting命名空间使用formatter更改输出的大小:

using Microsoft.DotNet.Interactive.Formatting; 
Formatter.ListExpansionLimit = 25;

docs

  • form> form> formatter.listexpansionlimit 20 <20 <20 < /p>

    获取或设置将从iEnumerable sequence中详细编写的项目数量的限制。

  • formatter&lt; t&gt; .listexpansionlimit =(未设置)

    可选类型的特定列表扩展限制

You can use Formatter from Microsoft.DotNet.Interactive.Formatting namespace to change the size of the output:

using Microsoft.DotNet.Interactive.Formatting; 
Formatter.ListExpansionLimit = 25;

Docs:

  • Formatter.ListExpansionLimit = 20

    Gets or sets the limit to the number of items that will be written out in detail from an IEnumerable sequence.

  • Formatter<T>.ListExpansionLimit = (not set)

    An optional type-specific list expansion limit

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文