Soenneker.Enumerables.CommaSeparated 11.0.34

Prefix Reserved
dotnet add package Soenneker.Enumerables.CommaSeparated --version 11.0.34
                    
NuGet\Install-Package Soenneker.Enumerables.CommaSeparated -Version 11.0.34
                    
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="Soenneker.Enumerables.CommaSeparated" Version="11.0.34" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Enumerables.CommaSeparated" Version="11.0.34" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Enumerables.CommaSeparated" />
                    
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 Soenneker.Enumerables.CommaSeparated --version 11.0.34
                    
#r "nuget: Soenneker.Enumerables.CommaSeparated, 11.0.34"
                    
#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 Soenneker.Enumerables.CommaSeparated@11.0.34
                    
#: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=Soenneker.Enumerables.CommaSeparated&version=11.0.34
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Enumerables.CommaSeparated&version=11.0.34
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Enumerables.CommaSeparated

Enumerates simple comma-delimited text as trimmed ReadOnlySpan<char> tokens without allocating a string or array for each value.

Install

dotnet add package Soenneker.Enumerables.CommaSeparated

Enumerate values

using Soenneker.Enumerables.CommaSeparated;

ReadOnlySpan<char> input = "alpha, beta, ,gamma";

foreach (ReadOnlySpan<char> token in new CommaSeparatedEnumerable(input))
{
    // token is "alpha", then "beta", then "gamma"
    Process(token);
}

Leading and trailing whitespace is trimmed from each token. Empty entries—including whitespace-only entries—are skipped. A null string constructor argument behaves like an empty input.

Parse without intermediate strings

Many framework parsing APIs accept spans directly:

var values = new CommaSeparatedEnumerable("10, 20, 30");
var total = 0;

foreach (ReadOnlySpan<char> value in values)
    total += int.Parse(value);

int count = values.Count(); // 3

Count() scans the input independently; it does not cache tokens. Calling it and then enumerating performs two passes.

Boundaries

This is not a CSV parser. Commas always delimit values, and quoting, escaped commas, embedded records, and alternate separators are not supported. Use a CSV library when inputs can contain those features.

Both the enumerable and enumerator are ref struct types. They cannot be boxed, stored on the heap, used across await or yield, or exposed as IEnumerable<T>. Each Current span points into the original input; call ToString() if a token must outlive that input or the current synchronous scope.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net11.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Enumerables.CommaSeparated:

Package Downloads
Soenneker.Extensions.Type

An extension library for useful Type operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.34 2,534 11/11/2026
11.0.33 15,800 10/26/2026
4.0.32 8,251 10/14/2026
4.0.31 958 10/14/2026
4.0.29 844 10/13/2026
4.0.26 1,000 10/12/2026
4.0.25 156 10/12/2026
4.0.24 4,833 10/11/2026
4.0.23 16,580 9/24/2026
4.0.22 7,997 9/15/2026
4.0.21 8,779 9/12/2026
4.0.20 29,242 8/30/2026
4.0.19 119 8/29/2026
4.0.18 267 8/29/2026
4.0.17 30,125 7/27/2026
4.0.16 11,066 7/16/2026
4.0.15 17,900 6/19/2026
4.0.14 20,072 6/5/2026
4.0.13 868 6/5/2026
4.0.12 23,067 4/22/2026
Loading failed

Upgrade .NET 11 release candidates to stable