Soenneker.Extensions.Enumerable.String 11.0.1528

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

alternate text is missing from this package README image Soenneker.Extensions.Enumerable.String

Joining, filtering, case-insensitive searching, casing, deduplication, and compound-ID projection extensions for string sequences.

Installation

dotnet add package Soenneker.Extensions.Enumerable.String

Join values

using Soenneker.Extensions.Enumerable.String;

string csv = new[] { "red", "green", "blue" }
    .ToCommaSeparatedString(includeSpace: true);
// red, green, blue

string path = new[] { "api", "customers", "42" }
    .ToSeparatedString('/');
// api/customers/42

Both methods return an empty string for a null or empty source. A null item is represented as an empty field, so new[] { "a", null, "b" } joined with commas becomes a,,b. Joining is immediate and visits the source once.

ToSeparatedStringFormattable() is the allocation-conscious overload for value types implementing ISpanFormattable; it avoids the boxing that the unconstrained overload can require. Formatting uses the type’s default format with a null format provider.

Search strings

string[] names = ["Alpha", "Beta"];

names.ContainsAPart("PH");         // true; ignores case by default
names.ContainsAPart("PH", false);  // false; ordinal, case-sensitive
names.ContainsIgnoreCase("alpha"); // true
names.StartsWithIgnoreCase("al");  // true
names.EndsWithIgnoreCase("TA");    // true

Searches are ordinal, skip null elements, stop at the first match, and do not allocate normalized copies. ContainsAPart() returns false for a null source or null/empty search text. The other search methods require non-null source and search arguments. An empty prefix or suffix matches when the sequence contains at least one non-null string.

Filter, normalize, and deduplicate

IEnumerable<string?> optionalValues = ["Alpha", null, " ", "alpha"];
IEnumerable<string> nonEmpty = optionalValues.ExceptNullOrEmpty();
IEnumerable<string> nonBlank = optionalValues.ExceptNullOrWhiteSpace();

IEnumerable<string> values = nonBlank;
IEnumerable<string> lower = values.ToLower();
IEnumerable<string> distinct = values.DistinctIgnoreCase();
HashSet<string> set = values.ToHashSetIgnoreCase();

These sequence-returning operations are lazy except ToHashSetIgnoreCase(), which materializes a new ordinal case-insensitive set. ExceptNullOrEmpty() preserves whitespace-only strings; ExceptNullOrWhiteSpace() removes them. ToLower() and ToUpper() use invariant casing and turn null elements into empty strings. DistinctIgnoreCase() skips nulls, keeps the first casing encountered, and preserves order.

Split compound IDs

List<(string PartitionKey, string DocumentId)> ids = new[]
{
    "customer-42:order-100",
    "standalone"
}.ToSplitIds();

// ("customer-42", "order-100")
// ("standalone", "standalone")

Each ID is split at its last colon, so earlier colons remain part of a compound partition key. The result is immediately materialized in source order. Null or empty IDs are rejected by the underlying split operation.

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.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Soenneker.Extensions.Enumerable.String:

Package Downloads
Soenneker.SendGrid.Contacts

Adds, retrieves, searches, and deletes SendGrid Marketing contacts.

Soenneker.HttpClients.LoggingHandler

A handler that allows for injecting into HttpClients to log requests and responses

Soenneker.Email.Sender

A high-level utility responsible for orchestrating the creation and delivery of templated email messages

Soenneker.Extensions.Objects.Reflection

Reflection-based object extensions for dictionaries, query strings, logging, and HTTP content.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1528 0 11/30/2026
11.0.1527 0 11/30/2026
11.0.1526 1,416 11/29/2026
11.0.1525 15,611 11/19/2026
11.0.1524 113 11/19/2026
11.0.1523 838 11/18/2026
11.0.1522 666 11/18/2026
11.0.1520 132 11/18/2026
11.0.1519 107 11/18/2026
11.0.1518 10,394 11/15/2026
11.0.1517 10,413 11/11/2026
11.0.1516 1,310 11/11/2026
11.0.1515 122 11/11/2026
11.0.1514 1,436 11/11/2026
11.0.1513 107 11/11/2026
11.0.1512 1,115 11/11/2026
11.0.1510 156 11/11/2026
11.0.1509 3,469 11/11/2026
11.0.1508 115 11/10/2026
11.0.1507 102 11/10/2026
Loading failed

Update soenneker/nuget-resilient-publish action to v5 (#2046)