sharpessentials.functions 1.2.7

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

SharpEssentials

Build Status Coverage NuGet

SharpEssentials is the ultimate C# utility library for .NET developers, helping you write cleaner, more efficient code with zero dependencies.


Table of Contents


Features

Core Utilities

  • Argument Validation: ThrowIfNull, ThrowIfEmpty, ThrowIfInvalid
  • Type Helpers: Safe casting, null coalescing, enum parsing
  • Exception Handling: Retry policies, exception unwrapping

Collections & LINQ

  • Batch, DistinctBy, ToDictionarySafe
  • ForEachWithIndex, Shuffle, Paginate

Functional Programming

  • Option<T>, Result<T>, Either<L, R>
  • Pattern matching extensions

String Operations

  • Truncation, formatting, validation
  • Levenshtein distance, phonetic matching

DateTime Helpers

  • Business day calculations
  • Timezone conversions
  • Human-readable intervals ("2 hours ago")

Installation

Use your preferred .NET package manager:

# NuGet Package Manager
Install-Package SharpEssentials

# .NET CLI
dotnet add package SharpEssentials

# Paket CLI
paket add SharpEssentials

Compatibility: .NET 8.0+


Getting Started

using SharpEssentials;

// Validate arguments
order.ThrowIfNull(nameof(order));

// Batch operations
var batches = Enumerable.Range(1, 1000).Batch(100);

// Functional result handling
var result = Result.Try(ParseConfigFile);
result.Match(
    success: config => Save(config),
    failure: ex => Log.Error(ex)
);

Usage Examples

Retry Policy with Exponential Backoff

var data = await RetryPolicy
    .WithExponentialBackoff(3, TimeSpan.FromSeconds(1))
    .ExecuteAsync(() => FetchRemoteDataAsync());

String Helpers

var clean = " HELLO world ".TrimAll(); // "HELLO world"
var similarity = "color".SimilarityTo("colour"); // 0.91

Why Choose SharpEssentials?

Metric SharpEssentials Alternatives
Performance ⚑ Optimized 🐒 Slower
Dependencies 0 3+
Maintenance Active Abandoned
Documentation βœ… Comprehensive Minimal
  • Battle-tested in production
  • Consistent, intuitive API
  • Detailed XML docs with examples

Documentation


Contributing

We welcome your contributions! Please:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m "Add AmazingFeature")
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request
git clone https://github.com/yourname/SharpEssentials.git
cd SharpEssentials
dotnet restore
dotnet build
dotnet test

Support & Community


License

Distributed under the MIT License. See LICENSE for details.


Thank you for choosing SharpEssentials! πŸŽ‰ Happy coding! πŸ’»πŸš€

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.

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.2.22 297 10/28/2025
1.2.21 239 9/29/2025
1.2.20 191 9/29/2025
1.2.19 215 7/18/2025
1.2.18 197 7/14/2025
1.2.17 126 7/12/2025
1.2.16 211 6/23/2025
1.2.15 193 6/19/2025
1.2.14 181 6/19/2025
1.2.13 197 6/18/2025
1.2.12 196 6/16/2025
1.2.11 247 6/13/2025
1.2.10 239 6/8/2025
1.2.9 112 6/6/2025
1.2.8 259 5/23/2025
1.2.7 196 5/21/2025
1.2.6 191 5/21/2025
1.2.5 190 5/19/2025
1.2.4 179 5/19/2025
1.2.3 191 5/19/2025
Loading failed