Digbyswift.Core 2.5.3-beta0

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

Digbyswift.Core

NuGet version (Digbyswift.Core) Build status

A library of general-use classes and extensions for everyday coding.

This includes:

Models

Constants

  • CharConstants, e.g. '@', '.'
  • StringConstants, e.g. "@", "."
  • NumericConstants
  • MimeTypeConstants
  • FileExtensions
  • AppEnvironments

Regular expressions

  • Email
  • UkPhoneNumber
  • AlphaNumeric
  • Numeric
  • WholeNumber
  • Url
  • Guid
  • Markup
  • IPv4
  • IPv6
  • FileExtension
  • IsoRegionalLanguage
  • HexColour
  • Dates
    • Universal format
    • UK format
  • Time
    • 12 hour
    • 12 hour with meridiem (am/pm)
    • 24 hour
    • 24 hour with seconds

Comparers

  • DateTimeComparer
  • NaturalComparer

Extensions

Enumerable

  • CountIs(int count)
  • CountIsLe(int count)
  • CountIsLt(int count)
  • CountIsGe(int count)
  • CountIsGt(int count)
  • IsEmpty()
  • MaxOrDefault()
  • MinOrDefault()
  • None(Func<T, bool> func)
  • NotContains(T item)
  • SkipLast()
  • WhereNotNull()

List

  • Any()
  • Crop(int toSize)

Dictionary

  • ContainsKeyAndValue(TKey key, TValue value)
  • ContainsKeyAndValue(TKey key, string value, StringComparison stringComparison)
  • GetOrDefault(TKey key, TValue defaultValue)
  • GetOrNull(TKey key)
  • Set(TKey key, TValue value)

NameValueCollection

  • CopyTo(IDictionary<string, string?> dict)
  • ToDictionary()
  • ToQueryString()

String

  • Base64Encode()
  • Base64Decode()
  • CapitalizeWords()
  • Coalesce(string valueWhenNullOrEmpty)
  • Contains(string toCheck, StringComparison comp)
  • ContainsIgnoreCase(string toCheck)
  • ContainsIgnoreCase(string toCheck)
  • EqualsIgnoreCase(string toCheck)
  • MaskRight(int numberOfVisibleCharacter)
  • MaskLeft(int numberOfVisibleCharacter)
  • RemoveWhitespace()
  • ReplaceExcess()
  • SplitAndTrim(params char[]? separator)
  • StripMarkup()
  • ToBool()
  • ToEnum()
  • ToUrlFriendly()
  • TrimWithin()
  • TrimToDefault(string? defaultValue)
  • Truncate(int length)
  • Truncate(int length, string suffix)
  • TruncateAtWord(int length)
  • TruncateAtWord(int length, string suffix)

String validation

  • ContainsEmail()
  • ContainsGuid()
  • ContainsHexColour()
  • ContainsIPv4()
  • ContainsIPv6()
  • ContainsMarkup()
  • ContainsUkTelephone()
  • HasUkMobileNumberPrefix()
  • ContainsUrl()
  • HasFileExtension()
  • IsAlphaNumeric()
  • IsEmail()
  • IsGuid()
  • IsHexColour()
  • IsIsoRegionalLanguage()
  • IsIPv4()
  • IsIPv6()
  • IsJson()
  • IsMarkup()
  • IsNumeric()
  • IsUrl()
  • IsWholeNumber()
  • IsUkTelephone()

String compression

  • Compress()
  • Decompress()

Boolean

  • AsYesNo()
  • AsYesNo(string nullDefault)

DateTime

  • AsKind(DateTimeKind kind)
  • GetDaysUntil(DateTime value)
  • GetAgeNextBirthday(DateTime dob)
  • GetAge(DateTime dob)
  • IsAfter(DateTime otherDate)
  • IsBefore(DateTime otherDate)
  • SubtractDays(int days)
  • SubtractMonths(int months)
  • SubtractYears(int years)
  • TruncateTime(TimePrecision precision)
  • ToInvariantString()
  • ToSortableString()
  • ToUnixTimeSeconds()

Guid

  • Segments()
  • FirstSegment()

Numeric

  • AsPercentageOf(int total)
  • AsPercentageOf(decimal total)
  • AsPercentageOf(double total)
  • Equals(double compareTo, double decimalPlaces)
  • IsZero()
  • IsEven()
  • Truncate(int decimalPlaces)
  • ToInvariantString()

Encryption

  • RSAEncrypt()
  • RSAEncrypt(string publicKeyXml)
  • RSADecrypt()
  • RSADecrypt(string privateKeyXml)

StringBuilder

  • EnsureTrailingCharacter(char character)
  • TrimEnd(char? character = null)

Assembly

  • GetTypesAssignableFrom<T>()
  • GetTypesAssignableFrom(Type compareType)

Third-party

Loqate
  • IsLoqateAddressId()
  • IsLoqateContainerId()
Youtube
  • IsYouTubeUrl()
  • ExtractYouTubeVideoId()
  • ToYouTubeThumbnailUrl()
  • ToYouTubeEmbedUrl()
  • ParseYoutubeQueryString()
Vimeo
  • IsVimeoUrl()
  • IsVimeoEventUrl()
  • ExtractVimeoVideoId()
  • ToVimeoEmbedUrl()
Twitter
  • IsTweetUrl()
  • ExtractIdFromTweetUrl()
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 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 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. 
.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 is compatible.  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.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Digbyswift.Core:

Package Downloads
Digbyswift.Umbraco.Web

Package Description

Digbyswift.Http

Package Description

Digbyswift.Middleware.BasicAuth

Package Description

Digbyswift.Umbraco.OrphanedLinks

Package Description

Digbyswift.AspNet

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.5.4 146 7/14/2025
2.5.3 142 7/14/2025
2.5.3-beta1 93 7/11/2025
2.5.3-beta0 91 7/11/2025
2.5.2 144 7/7/2025
2.5.1 686 4/8/2025
2.5.0 152 2/28/2025
2.3.0 185 1/15/2025
2.2.0 1,007 9/29/2024
2.1.0 4,601 7/3/2023
2.0.3 707 6/29/2023
2.0.2 680 6/14/2023
2.0.1 1,860 5/24/2023
2.0.0 1,056 4/7/2023
1.1.2 1,491 12/19/2022
1.1.1 2,035 12/19/2022
1.1.0 1,006 12/19/2022
1.0.4 1,877 5/12/2022
1.0.3 3,032 5/12/2022
1.0.2 1,077 10/2/2021
1.0.1 883 10/2/2021
1.0.0 2,324 9/30/2021