A library of extensions to core .NET functionality.
The core .NET libraries - those that are available on most .NET runtime versions and environments -
are very feature-rich. However, there are times when you need a little helper function, and the list
of those functions slowly grows. Rather than having disparate collections of them, this project seeks
to group them under the WhatIsHeDoing.Core
namespace, complete with unit tests in the WhatIsHeDoing.Core.Tests
project.
Take a look at the editable code examples at .NET Fiddle.
This package is available via NuGet.
GetNextWeekday
: Gets the date at the next weekday supplied.PeriodsBetween
: Generates the periods between two date times.
Aggregate
: Aggregate with the index of the current element.IterateJagged
: Flattens a collection of collections of unequal lengths after callingZipJagged
.Randomise
: Returns a randomised order of the collection.WhereNotNull
: Filters all null elements from a collection.ZipJagged
: Enables a collection of unequal collection lengths to be iterated together, effectively as columns.
ToNearestCeiling
: Rounds to the largest comparison number.
Length
: Determines the length of a positive number.StripDigits
: Strips a specified number of digits from a number.
AsFluent
: Calls any action fluently, such as void functions, so that calls can be chained to other members of object.
AsCurrency
: Formats a string as a currency from the current globalisation.IsTrue
: Determines whether this string can be converted to a boolean and that value is true.Parse
: Invoke a Parse method from the TResult type on the value.ToBytes
: Converts a string representation of a byte array - comma-separated values - to an actual byte array.TryParse
: Tries to invoke a Parse method from the TResult type on the value.
Length
: Determines the length of a number.StripDigits
: Strips a specified number of digits from a number.
Missing something? Have you tried these excellent projects?
- Humanizr: Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities.
- NodaTime: A better date and time API for .NET.
All contributions are greatly welcomed! Please see the guidelines for more information.
If you are developing locally, pull down this repo and build within Visual Studio (any edition), or
run dotnet test
on any platform; the live
branch is continuously built on both Windows
and Linux. Alternatively, create a new Codenvy workspace from my factory!
- Darren Hickling: https://darrenhickling.com/