Kotz.Extensions 2.0.0-nightly-015

This is a prerelease version of Kotz.Extensions.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Kotz.Extensions --version 2.0.0-nightly-015                
NuGet\Install-Package Kotz.Extensions -Version 2.0.0-nightly-015                
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="Kotz.Extensions" Version="2.0.0-nightly-015" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kotz.Extensions --version 2.0.0-nightly-015                
#r "nuget: Kotz.Extensions, 2.0.0-nightly-015"                
#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.
// Install Kotz.Extensions as a Cake Addin
#addin nuget:?package=Kotz.Extensions&version=2.0.0-nightly-015&prerelease

// Install Kotz.Extensions as a Cake Tool
#tool nuget:?package=Kotz.Extensions&version=2.0.0-nightly-015&prerelease                

Kotz.Extensions

Defines the following extension methods:

  • Array Extensions
    • Several wrappers for System.Array static methods.
  • List Extensions
    • AsSpan: Gets the current list as a Span<T> object.
  • Span Extensions
    • Rotate: Rotates a span from a starting position by the specified amount of indices.
  • IReadOnlyList<T> Extensions
    • TryGetValue: safely get an element from the collection, or default(T) if it fails.
    • IndexOf: Get the index of the first element that matches a predicate.
    • LastIndexOf: Get the index of the last element that matches a predicate.
  • DateTimeOffset Extensions
    • StartOfDay: Gets the beginning of the day for the current DateTimeOffset object.
  • Enum Extensions
    • ToggleFlag: Returns an enum with the provided bit flag set if it's not currently set, and vice-versa.
    • HasOneFlag: Checks if the current enum has at least one of the provided bit flags.
    • ToStrings: Creates a collection of human-readable strings of the current enum.
    • ToFlags: Flattens a collection of enums to a single enum value that contains all bit flags from the enums in the collection. It's the opposite of ToValues().
    • ToValues: Segregates bit flags into a collection of enum values of their own. It's the opposite of ToFlags().
  • IEnumerable<T> Extensions
    • When: Fluent version of an if statement.
    • ToConcurrentDictionary: Converts the current collection to a ConcurrentDictionary<T, U>.
    • ContainsSubcollection: Checks if the current collection contains all elements of a given collection.
    • ContainsOne: Checks if the current collection contains at least one element of a given collection.
    • WhenAllAsync: Awaits all tasks in the current IEnumerable<Task> and returns when all of them have completed.
    • WhenAnyAsync: Awaits all tasks in the current IEnumerable<Task> and returns when any of them have completed.
    • ExceptBy: Gets the symmetric difference between two collections based on a key selector.
    • IntersectBy: Gets the intersection between two collections based on a key selector.
    • NestedFill: Adds a sample object to the inner collections of a collection of collections until they all have the same length.
    • ChunkBy: Splits a collection into a collection of collections based on the provided key selector.
    • RandomElement: Gets a random element from the current collection.
    • Unique: Gets the symetric difference between all elements in the current and specified collections.
  • Object Extensions
    • EqualsAny: Checks whether the current object equals any of the specified objects.
  • StringBuilder Extensions
    • ReplaceAll: Replaces all instances of a substring with another substring, even if the new substring is a substring of the old substring.
    • ToStringAndClear: Returns the string value of the current builder and clears the builder.
  • String Extensions
    • EqualsOrStartsWith: Checks if the current string is <u>equal</u> or <u>starts with the first character</u> of another provided string.
    • MaxLength: Truncates the string to the maximum specified length.
    • ToSnakeCase: Converts the current string to the snake_case format.
    • Occurrences: Gets the amount of occurences of a given character in the current string.
    • MaxElementLength: Get the length of the longest string of the current collection.
    • Equals: Checks whether the current string is equal to any of the provided strings.
    • Contains: Checks if the current string occurs within at least one of the entries in the provided collection.
    • EndsWith: Checks whether the end of the current string matches any string stored in the provided collection.
    • StartsWith: Checks whether the beginning of the current string matches any string stored in the provided collection.
    • GetDigits: Returns a string with all digits present in this string.
    • FirstOccurrenceOf: Returns the "Nth" index of the provided character.
    • LastOccurrenceOf: Returns the last "Nth" index of the provided character.
    • HasFirstWordOf: Checks if the current string and the provided string contain the same first word.
Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Kotz.Extensions:

Package Downloads
Kotz.Utilities

Provides utility types and methods for common tasks. This is a metapackage that includes all Kotz utility packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.3-nightly-075 84 5/25/2024
2.3.2 103 5/25/2024
2.3.1 98 5/25/2024
2.3.0 97 5/24/2024
2.3.0-nightly-070 82 5/24/2024
2.3.0-nightly-069 90 5/24/2024
2.3.0-nightly-068 85 5/24/2024
2.3.0-nightly-067 84 5/24/2024
2.3.0-nightly-066 87 5/24/2024
2.3.0-nightly-065 77 5/23/2024
2.3.0-nightly-064 80 5/23/2024
2.3.0-nightly-062 80 5/16/2024
2.2.2-nightly-059 82 4/16/2024
2.2.2-nightly-058 64 4/10/2024
2.2.2-nightly-057 72 4/9/2024
2.2.2-nightly-056 62 4/4/2024
2.2.1 134 3/21/2024
2.2.1-nightly-054 53 3/21/2024
2.2.1-nightly-053 65 3/20/2024
2.2.1-nightly-051 69 3/16/2024
2.2.0 179 12/17/2023
2.2.0-nightly-049 63 12/23/2023
2.2.0-nightly-048 81 12/17/2023
2.2.0-nightly-042 87 9/23/2023
2.2.0-nightly-041 83 9/23/2023
2.2.0-nightly-039 88 9/23/2023
2.1.1 123 9/23/2023
2.1.1-nightly-038 85 9/16/2023
2.1.1-nightly-037 112 8/19/2023
2.1.0 157 8/11/2023
2.1.0-nightly-036 112 8/11/2023
2.1.0-nightly-035 105 5/20/2023
2.1.0-nightly-034 159 1/9/2023
2.1.0-nightly-033 141 12/2/2022
2.0.0 393 11/23/2022
2.0.0-nightly-028 120 11/3/2022
2.0.0-nightly-027 154 10/19/2022
2.0.0-nightly-026 138 10/9/2022
2.0.0-nightly-025 142 10/8/2022
2.0.0-nightly-023 152 9/25/2022
2.0.0-nightly-021 138 9/23/2022
2.0.0-nightly-020 149 9/15/2022
2.0.0-nightly-018 197 9/15/2022
2.0.0-nightly-017 254 8/23/2022
2.0.0-nightly-016 139 8/22/2022
2.0.0-nightly-015 273 7/17/2022
2.0.0-nightly-014 160 7/17/2022
1.1.2 601 4/14/2022
1.1.2-nightly-09 144 6/1/2022
1.1.2-nightly-013 162 7/17/2022
1.1.2-nightly-012 161 7/2/2022
1.1.2-nightly-011 154 6/19/2022
1.1.2-nightly-010 133 6/19/2022
1.1.1-nightly-07 156 4/14/2022
1.1.1-nightly-06 170 4/14/2022
1.1.0 537 4/12/2022
1.0.0 525 4/7/2022
1.0.0-nightly-04 151 4/7/2022
1.0.0-nightly 176 4/7/2022