Kotz.Extensions 2.0.0-nightly-014

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-014                
NuGet\Install-Package Kotz.Extensions -Version 2.0.0-nightly-014                
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-014" />                
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-014                
#r "nuget: Kotz.Extensions, 2.0.0-nightly-014"                
#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-014&prerelease

// Install Kotz.Extensions as a Cake Tool
#tool nuget:?package=Kotz.Extensions&version=2.0.0-nightly-014&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 (2)

Showing the top 2 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.

Json2Sharp

Parse JSON data into class definitions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.3-nightly-075 87 5/25/2024
2.3.2 122 5/25/2024
2.3.1 100 5/25/2024
2.3.0 101 5/24/2024
2.3.0-nightly-070 82 5/24/2024
2.3.0-nightly-069 91 5/24/2024
2.3.0-nightly-068 86 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 81 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 136 3/21/2024
2.2.1-nightly-054 55 3/21/2024
2.2.1-nightly-053 65 3/20/2024
2.2.1-nightly-051 69 3/16/2024
2.2.0 182 12/17/2023
2.2.0-nightly-049 66 12/23/2023
2.2.0-nightly-048 83 12/17/2023
2.2.0-nightly-042 90 9/23/2023
2.2.0-nightly-041 86 9/23/2023
2.2.0-nightly-039 91 9/23/2023
2.1.1 126 9/23/2023
2.1.1-nightly-038 88 9/16/2023
2.1.1-nightly-037 114 8/19/2023
2.1.0 158 8/11/2023
2.1.0-nightly-036 115 8/11/2023
2.1.0-nightly-035 108 5/20/2023
2.1.0-nightly-034 162 1/9/2023
2.1.0-nightly-033 145 12/2/2022
2.0.0 399 11/23/2022
2.0.0-nightly-028 123 11/3/2022
2.0.0-nightly-027 157 10/19/2022
2.0.0-nightly-026 142 10/9/2022
2.0.0-nightly-025 145 10/8/2022
2.0.0-nightly-023 155 9/25/2022
2.0.0-nightly-021 141 9/23/2022
2.0.0-nightly-020 152 9/15/2022
2.0.0-nightly-018 200 9/15/2022
2.0.0-nightly-017 259 8/23/2022
2.0.0-nightly-016 143 8/22/2022
2.0.0-nightly-015 276 7/17/2022
2.0.0-nightly-014 163 7/17/2022
1.1.2 608 4/14/2022
1.1.2-nightly-09 148 6/1/2022
1.1.2-nightly-013 166 7/17/2022
1.1.2-nightly-012 164 7/2/2022
1.1.2-nightly-011 157 6/19/2022
1.1.2-nightly-010 137 6/19/2022
1.1.1-nightly-07 159 4/14/2022
1.1.1-nightly-06 173 4/14/2022
1.1.0 543 4/12/2022
1.0.0 529 4/7/2022
1.0.0-nightly-04 154 4/7/2022
1.0.0-nightly 181 4/7/2022