Fabricale.Extensions 1.1.0

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

Fabricale Extensions

nuget GitHub release NuGet license

A library providing extension methods.

This library is still under development and more updates are being released.

Check the Change Log for more information about the deployed changes.

String Extensions

The library provides the following extensions to the string class:

Method Purpose
Find() Returns a list with all the locations where the text is found in a string
MultiReplace() Replaces multiple instances of a string in the text
ContainsOnly() Checks whether a string contains only certain characters
ContainsOnlyNumbers() Checks whether a string only contains numbers
ContainsOnlyAsciiLetters() Checks whether a string only contains Ascii letters
ContainsOnlyAsciiLettersAndNumbers() Checks whether a string only contains Ascii letters and numbers
ConvertToAsciiBooleanArray() Generates a boolean array with the ASCII characters inside the given string

These methods are optimized for performance. The ASCII specific methods use an array of booleans to make the search fast. The Non-ASCII specific methods use a HashSet, which adds the cost of the hashing to the search, but still keep it fast.

The functionality is tested with Unicode characters.

The functions Find() and MultiReplace() are going to be optimized for better performance in a future release. After running benchmarks, the performance is not much better than just using the traditional String.Replace() method. When this optimization is deployed, you will not need to execute changes to your code to benefit from it.

When using the ContainsOnly() method, there is a constructor available that accepts a HashSet<char>. If the same characters are used frequently, consider reusing it instead of creating the HashSet on each call.

If you have a specific list of ASCII characters that you want to check, consider using the extension method ConvertToAsciiBolleanArray() to create an array with the acceptable characters, and cache it.

DateTime Extensions

The library provides the following extensions to the string class:

Method Purpose
AddBusinesDays() Adds or Subtracts Business Days to a Date
ToJulian() Converts a DateTime into a double representing the Julian Date

The AddBusinessDays() function will add or subtract days, ignoring weekends. Holidays are not taken into consideration. A future release should include that functionality.

CharComparer

This class offers the option to compare characters.

The following comparers are available:

Class Purpose
CaseSensitiveCharComparer This class compare two characters and ensure the casing is taken into consideration
CaseInsensitiveCharComparer This class compares two characters, ignoring the casing
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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 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 is compatible.  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 is compatible.  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.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.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.1.0 104 6/8/2026
1.0.0 107 6/1/2026
0.1.0-alpha.3 57 5/29/2026
0.1.0-alpha.2 72 5/29/2026
0.1.0-alpha.1 61 5/28/2026