EnumerablePrinter 1.0.1

dotnet add package EnumerablePrinter --version 1.0.1
                    
NuGet\Install-Package EnumerablePrinter -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EnumerablePrinter" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EnumerablePrinter" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="EnumerablePrinter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EnumerablePrinter --version 1.0.1
                    
#r "nuget: EnumerablePrinter, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EnumerablePrinter@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EnumerablePrinter&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=EnumerablePrinter&version=1.0.1
                    
Install as a Cake Tool

EnumerablePrinter

NuGet Build

A lightweight C# extension that brings Python-style print() elegance to your IEnumerable<T>. Debug smarter, print cleaner.


✨ Features

  • Format any IEnumerable<T> like { a, b, c }
  • Customize output with a lambda (e.g., item => $"[{item}]")
  • Print to Console, StringWriter, StreamWriter, or any TextWriter
  • Modern C# 11 / .NET 8 compatible

🚀 Installation

dotnet add package EnumerablePrinter

🧪 Test

dotnet test

Sample expectation:

Enumerable.Empty<int>().Print();
// Output: { }

🧰 Usage

Add using EnumerablePrinter; at the top of your file, and you're good to go.

➤ Basic Usage

new[] { 1, 2, 3 }.Print();
// Output: { 1, 2, 3 }

➤ Empty Collections

Enumerable.Empty<int>().Print();
// Output: { }

➤ With Custom Formatting

var names = new List<string> { "Wayne", "Lucius", "Alfred" };
names.Print(n => $"[{n}]");
// Output: { [Wayne], [Lucius], [Alfred] }

➤ Redirecting Output (e.g. to logs or buffer)

using var writer = new StringWriter();
names.Print(n => n.ToUpper(), writer);
Console.WriteLine(writer.ToString());
// Output: { WAYNE, LUCIUS, ALFRED }


📝 License

Licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 133 7/10/2025