DotNetExtensionKit 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package DotNetExtensionKit --version 1.0.3
                    
NuGet\Install-Package DotNetExtensionKit -Version 1.0.3
                    
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="DotNetExtensionKit" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetExtensionKit" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="DotNetExtensionKit" />
                    
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 DotNetExtensionKit --version 1.0.3
                    
#r "nuget: DotNetExtensionKit, 1.0.3"
                    
#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 DotNetExtensionKit@1.0.3
                    
#: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=DotNetExtensionKit&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=DotNetExtensionKit&version=1.0.3
                    
Install as a Cake Tool

DotNetExtensionKit

NuGet License: MIT

A lightweight .NET library of extension methods for strings, collections, dates, and general utilities. Targets .NET Standard 2.0 for broad compatibility.

Features

  • String — truncation, case conversion, masking, slug generation, Base64, character filtering
  • Collection — null-safe access, batching, iteration helpers, distinct-by-key
  • DateTime — day/week/month/year boundaries, age calculation, weekend checks
  • General — null checks, safe casting, conditional transforms, range and membership checks

Installation

dotnet add package DotNetExtensionKit

Or via the NuGet Package Manager:

Install-Package DotNetExtensionKit

Quick Start

using DotNetExtensionKit;

// Strings
"Hello, World!".Truncate(5);           // "Hello"
"HelloWorld".ToSnakeCase();            // "hello_world"
"1234567890".Mask();                   // "12******90"
"Hello World!".ToSlug();               // "hello-world"

// Collections
var batches = new[] { 1, 2, 3, 4, 5 }.Batch(2);  // { {1,2}, {3,4}, {5} }
List<int>? items = null;
items.IsNullOrEmpty();                 // true
items.OrEmpty();                       // safe empty enumerable

// DateTime
var now = DateTime.Now;
now.StartOfDay();                      // today at 00:00:00
now.StartOfWeek();                     // most recent Monday
new DateTime(1990, 3, 25).Age();       // age in years

// General
"hello".Transform(s => s.Length);      // 5
5.IsBetween(1, 10);                    // true
"b".IsIn("a", "b", "c");              // true

Documentation

Full API reference is available at the documentation site.

Compatibility

This library targets .NET Standard 2.0, which is supported by:

Platform Minimum Version
.NET / .NET Core 2.0+
.NET Framework 4.6.1+
Mono 5.4+
Xamarin.iOS 10.14+
Xamarin.Mac 3.8+
Xamarin.Android 8.0+
UWP 10.0.16299+
Unity 2018.1+

The library uses C# 8.0 with nullable reference types enabled.

Contributing

Contributions are welcome. Please open an issue to discuss your idea before submitting a pull request.

  1. Fork the repository
  2. Create a feature branch (git checkout -b my-feature)
  3. Commit your changes (git commit -m "Add my feature")
  4. Push to the branch (git push origin my-feature)
  5. Open a Pull Request

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.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.6 79 3/25/2026
1.0.5 81 3/24/2026
1.0.4 80 3/20/2026
1.0.3 76 3/20/2026
1.0.0 82 3/20/2026