Digbyswift.Core 2.7.1

Prefix Reserved
dotnet add package Digbyswift.Core --version 2.7.1
                    
NuGet\Install-Package Digbyswift.Core -Version 2.7.1
                    
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.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Digbyswift.Core" Version="2.7.1" />
                    
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.7.1
                    
#r "nuget: Digbyswift.Core, 2.7.1"
                    
#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.7.1
                    
#: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.7.1
                    
Install as a Cake Addin
#tool nuget:?package=Digbyswift.Core&version=2.7.1
                    
Install as a Cake Tool

Digbyswift.Core

NuGet version (Digbyswift.Core) Build and publish package

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

This includes:

Models

Constants

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

Regular expressions

  • Email
  • UkPhoneNumber
  • AlphaNumeric
  • Numeric
  • Decimal
  • 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
  • NaturalStringComparer

Enums

  • DateTimeComparePrecision
  • NumericMatchType
  • TimePrecision

Serialization

  • NumericBooleanConverter

IO

  • Utf8StringWriter

Exceptions

  • ArgumentEmptyException

Extensions

Enumerable

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

List

  • Any<T>()
  • Crop<T>(int toSize)

Dictionary

  • ContainsKeyAndValue<TKey, TValue>(TKey key, TValue value)
  • ContainsKeyAndValue<TKey>(TKey key, string value, StringComparison stringComparison = StringComparison.CurrentCulture)
  • GetValueOrDefault<TKey, TValue>(TKey key, TValue defaultValue) (not available on .NET 6+)
  • GetValueOrNull<TKey, TValue>(TKey key) (.NET Framework and .NET Standard)
  • Set<TKey, TValue>(TKey key, TValue value)

NameValueCollection

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

String

  • Base64Encode()
  • Base64Decode()
  • CapitalizeWords()
  • Coalesce(string fallback)
  • Coalesce(string? optionalFallback, string requiredFallback)
  • Contains(string toCheck, StringComparison comp) (not available on .NET 6+)
  • ContainsIgnoreCase(string toCheck)
  • ContainsIgnoreCase(IEnumerable<string> value, string toCheck)
  • ContainsUppercaseAscii()
  • CollapseSlashes() (.NET 6+)
  • EndsWithIgnoreCase(string withValue)
  • EqualsIgnoreCase(string toCheck)
  • MaskRight(int numberOfVisibleCharacter, char maskingCharacter = CharConstants.Asterisk)
  • MaskLeft(int numberOfVisibleCharacter, char maskingCharacter = CharConstants.Asterisk)
  • RemoveNonWordCharacters()
  • RemoveWhitespace()
  • ReplaceExcess(char characterToReplace, char characterToReplaceWith, int minimumOccurrences = 2)
  • SplitAndTrim(params char[] separator)
  • StartsWithIgnoreCase(string withValue)
  • StripMarkup()
  • ToBool(bool? defaultValue)
  • ToEnum<TEnum>()
  • ToUrlFriendly()
  • ToUrlFriendly(Encoding outputEncoding)
  • TrimToDefault(string? defaultValue = null)
  • TrimToNull()
  • TrimWithin()
  • Truncate(int length)
  • Truncate(int length, string suffix)
  • TruncateAtWord(int length)
  • TruncateAtWord(int length, string suffix)

String validation

  • ContainsEmail()
  • ContainsIPv4()
  • ContainsIPv6()
  • ContainsMarkup()
  • ContainsUkTelephone()
  • ContainsUrl()
  • HasFileExtension()
  • HasFileExtension(int minLength, int maxLength = Int32.MaxValue)
  • HasUkMobileNumberPrefix()
  • IsAlphaNumeric()
  • IsEmail()
  • IsHexColor()
  • IsIsoRegionalLanguage()
  • IsIPv4()
  • IsIPv6()
  • IsJson()
  • IsMarkup()
  • IsNumeric(NumericMatchType matchType = NumericMatchType.Any)
  • IsUrl()
  • IsWholeNumber()
  • IsUkTelephone()

String compression

  • Compress()
  • Decompress()

Boolean

  • AsYesNo()
  • AsYesNo(string valueWhenNull)

DateTime

  • Age()
  • AgeNextBirthday()
  • AsKind(DateTimeKind kind)
  • DaysUntil()
  • IsAfter(DateTime otherDate)
  • IsBefore(DateTime otherDate)
  • SubtractDays(int days)
  • SubtractMonths(int months)
  • SubtractYears(int years)
  • ToInvariantString()
  • ToSortableString()
  • ToUnixTimeSeconds()
  • TruncateTime(TimePrecision precision)

Guid

  • Segments()
  • FirstSegment()

Numeric

Int
  • AsPercentageOf(int total)
  • IsEven()
  • ToInvariantString()
Decimal
  • AsPercentageOf(decimal total)
  • ToInvariantString()
Double
  • AsPercentageOf(double total)
  • Equals(double compareTo, double decimalPlaces)
  • IsZero()
  • Truncate(int decimalPlaces)
  • ToInvariantString()
Short
  • ToInvariantString()
UShort
  • ToInvariantString()
UInt
  • ToInvariantString()
Long
  • ToInvariantString()
ULong
  • ToInvariantString()

Encryption

RSA
  • RSAEncrypt()
  • RSAEncrypt(string publicKeyXml)
  • RSADecrypt()
  • RSADecrypt(string privateKeyXml)
SHA
  • ToSHA1Hash()
  • ToSHA256Hash()
  • ToSHA384Hash()
  • ToSHA512Hash()

StringBuilder

  • EnsureTrailingCharacter(char character)
  • TrimEnd(char? character = null)
  • Truncate(int maxLength)

Assembly

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

Enum

  • Parse<T>(string value, T defaultValue = default) (.NET Framework)

HttpContent (.NET Standard 2.0 & .NET 8 only)

  • ReadAsJsonAsync<T>(JsonSerializerSettings? options = null)

HttpContext (.NET Standard 2.0 & .NET 8 only)

  • IsAuthenticated()

HttpRequest (.NET Standard 2.0 & .NET 8 only)

  • AcceptsWebP()
  • AsForwarded()
  • GetAbsoluteBaseUri()
  • GetAbsoluteBaseUrl()
  • GetAbsoluteUri()
  • GetAbsoluteUrl()
  • GetClientIp()
  • GetDomainInfo()
  • GetRawReferrer()
  • GetReferrer()
  • GetSameHostReferrer(bool allowSubDomains = false)
  • GetSameHostReferrerOrDefault(bool allowSubDomains = false, string? defaultReferrer = null)
  • GetUserAgent()
  • HasReferrer()
  • HasUserAgent(string? specificUserAgent = null)
  • IsAjaxRequest()
  • IsGetMethod()
  • IsHeadMethod()
  • IsInternetExplorer11()
  • IsPngOrJpeg()
  • IsPostMethod()
  • IsSvg()
  • PathAndQueryKeyOnly(string key, string? defaultValue)
  • PathAndQueryReplaceValueOfKey(string replaceKey, object value)
  • PathAndQueryWithoutKey(string excludeKey)
  • PathAndQueryWithoutKeys(params string[] excludeKeys)
  • PathFileExtension()
  • PathHasFileExtension()
  • TryGetReferrer(out Uri? referringUri)
  • TryGetSameHostReferrer(out Uri? referringUri)

HttpResponse (.NET Standard 2.0 & .NET 8 only)

  • SetNoCacheHeaders()

HttpResponseMessage (.NET Standard 2.0 & .NET 8 only)

  • IsStatusCodeSuitableForRetry()

PathString (.NET Standard 2.0 & .NET 8 only)

  • SegmentAt(int index)
  • SegmentAtOrDefault(int index, string? defaultSegment = null)
  • Segments()

Uri (.NET Standard 2.0 & .NET 8 only)

  • GetDomainInfo()
  • ToBareUri()
  • ToBareUrl()
  • ToBaseUri()

Third-party

Loqate
  • IsLoqateAddressId()
  • IsLoqateContainerId()
Youtube
  • IsYouTubeUrl()
  • ExtractYouTubeVideoId()
  • ToYouTubeThumbnailUrl()
  • ToYouTubeEmbedUrl()
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 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 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 (8)

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.SeoEditor

A property editor for metadata, largely inspired by the v7 SeoMetadata package.

Digbyswift.Umbraco.OrphanedLinks

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.7.1 94 7/12/2026
2.7.0 104 7/12/2026
2.6.2 285 3/30/2026
2.6.1 434 12/3/2025
2.6.0 605 10/22/2025
2.5.6 318 8/22/2025
2.5.5 209 8/22/2025
2.5.4 380 7/14/2025
2.5.3 285 7/14/2025
2.5.3-beta1 179 7/11/2025
2.5.3-beta0 182 7/11/2025
2.5.2 274 7/7/2025
2.5.1 1,110 4/8/2025
2.5.0 277 2/28/2025
2.3.0 395 1/15/2025
2.2.0 1,492 9/29/2024
2.1.0 5,068 7/3/2023
2.0.3 796 6/29/2023
2.0.2 777 6/14/2023
2.0.1 2,101 5/24/2023
Loading failed