ByteDev.Collections 5.0.0

dotnet add package ByteDev.Collections --version 5.0.0                
NuGet\Install-Package ByteDev.Collections -Version 5.0.0                
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="ByteDev.Collections" Version="5.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ByteDev.Collections --version 5.0.0                
#r "nuget: ByteDev.Collections, 5.0.0"                
#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 ByteDev.Collections as a Cake Addin
#addin nuget:?package=ByteDev.Collections&version=5.0.0

// Install ByteDev.Collections as a Cake Tool
#tool nuget:?package=ByteDev.Collections&version=5.0.0                

ByteDev.Collections

Set of extended collections related functionality.

Installation

ByteDev.Collections has been written as a .NET Standard 2.0 library, so you can consume it from a .NET Core or .NET Framework 4.6.1 (or greater) application.

ByteDev.Collections is hosted as a package on nuget.org. To install from the Package Manager Console in Visual Studio run:

Install-Package ByteDev.Collections

Further details can be found on the nuget page.

Release Notes

Releases follow semantic versioning.

Full details of the release notes can be viewed on GitHub.

Usage

Extension methods

To use any extension methods simply reference the ByteDev.Collections namespace.

  • Array []:
    • Populate
    • SafeLength
  • Array [,]:
    • GetColumn
    • GetColumnCount
    • GetRow
    • GetRowCount
    • Populate
    • SafeLength
    • ToSingleDimension
  • IDictionary<TKey, TValue>:
    • AddOrUpdate
    • AddRange
    • AddOrUpdateRange
    • AddIfNotContainsKey
    • ContainsAllKey
    • ContainsAnyKey
    • GetFirstValueIgnoreKeyCase
    • GetValueOrDefault
    • GetValuesIgnoreKeyCase
    • RenameKey
    • ToNameValueCollection
  • IEnumerable<T>:
    • Second
    • SecondOrDefault
    • Third
    • ThirdOrDefault
    • Fourth
    • FourthOrDefault
    • Fifth
    • FifthOrDefault
    • Sixth
    • SixthOrDefault
    • Seventh
    • SeventhOrDefault
    • Eigth
    • EigthOrDefault
    • Ninth
    • NinthOrDefault
    • Tenth
    • TenthOrDefault
    • AllUnique
    • Concat (params overloads)
    • ContainsAll
    • ContainsAny
    • Last(count)
    • MaxBy
    • MinBy
    • NullToEmpty
    • ForEach
    • Find
    • IsEmpty
    • IsNullOrEmpty
    • IsSingle
    • IsEquivalentTo
    • ToCsv
    • ToDelimitedString
    • ToWrappedString
  • IEnumerable<string>:
    • FirstLongest
    • FirstShortest
  • ICollection<T>:
    • AddIfNotContains
    • AddRange
    • Fill
    • IsIndexValid
    • RemoveRandom
    • RemoveWhere
    • TakeRandom
  • IList<T>:
    • NullToEmpty
    • MoveToFirst
    • MoveToLast
    • ReplaceAt
    • ReplaceAll
    • SafeGet
    • Shuffle
    • Swap
  • NameValueCollection:
    • AddOrUpdate
    • AddIfNotContainsKey
    • ContainsKey
    • ToDictionary
  • GenericExtensions
    • AsEnumerable
    • AsList
  • EnumeratorExtensions
    • MoveNext(count)

Sequences

The Sequencer class can be used to quickly create different sequences of numbers.

// Create different number sequences

using ByteDev.Collections.Sequences;

// ...

const int size = 8;

// 1, 1, 1, 1, 1, 1, 1, 1
IList<int> r = Sequencer.Repeating(size, 1);

// 1, 2, 3, 4, 5, 6, 7, 8
IList<int> n = Sequencer.Natural(size);

// 0, 1, 2, 3, 4, 5, 6, 7
IList<int> w = Sequencer.Whole(size);

// 0, 1, 2, 3, 4, 5, 6, 7
IList<int> i1 = Sequencer.Integers(size);

// -2, -1, 0, 1, 2, 3, 4, 5
IList<int> i2 = Sequencer.Integers(size, -2);

// 1, 3, 5, 7, 9, 11, 13, 15
IList<int> a = Sequencer.Arithmetic(size, 1, 2);

// 1, 2, 4, 8, 16, 32, 64, 128
IList<int> g = Sequencer.Geometric(size, 1, 2);

// 0, 1, 1, 2, 3, 5, 8, 13
IList<int> f = Sequencer.Fibonacci(size);

// 2, 3, 5, 7, 11, 13, 17, 19
IList<int> p = Sequencer.Primes(size);

// 10, 5, 16, 8, 4, 2, 1
IList<int> c = Sequencer.Collatz(10);

// 1, 3, 6, 10, 15, 21, 28, 36
IList<int> t = Sequencer.Triangular(size);

// 1, 4, 9, 16, 25, 36, 49, 64
IList<int> s = Sequencer.Square(size);

// 1, 8, 27, 64, 125, 216, 343, 512
IList<int> s = Sequencer.Cube(size);

// 2, 4, 8, 16, 32, 64, 128, 256
IList<int> p2 = Sequencer.PowerOfTwo(size);

// 0, 2, 4, 6, 8, 10, 12, 14
IList<int> e1 = Sequencer.Even(size);

// 4, 6, 8, 10, 12, 14, 16, 18
IList<int> e2 = Sequencer.Even(size, 4);

// 1, 3, 5, 7, 9, 11, 13, 15
IList<int> o1 = Sequencer.Odd(size);

// 3, 5, 7, 9, 11, 13, 15, 17
IList<int> o2 = Sequencer.Odd(size, 3);

// 1, 4, 10, 20, 35, 56, 84, 120
IList<int> tet = Sequencer.Tetrahedral(size, 3);
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 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. 
.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 was computed.  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.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ByteDev.Collections:

Package Downloads
ByteDev.Giphy

.NET Standard library SDK to help communicate with the Giphy API.

ByteDev.Subtitles.SubRip

.NET Standard library to help when using SubRip subtitles.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.0 253 9/25/2023
4.0.0 962 6/14/2022
3.4.0 332 1/12/2022
3.3.0 463 8/19/2021
3.2.0 359 8/13/2021
3.1.0 890 6/23/2021
3.0.0 467 3/17/2021
2.7.0 531 3/12/2021
2.6.0 354 1/28/2021
2.5.0 490 11/5/2020
2.4.0 433 10/14/2020
2.3.0 464 9/29/2020
2.2.0 860 7/13/2020
2.1.1 995 2/13/2020
2.1.0 555 1/18/2020
2.0.0 1,015 12/16/2019
1.4.0 558 11/5/2019
1.3.1 618 11/3/2019
1.3.0 543 11/2/2019
1.2.0 545 11/2/2019
1.1.0 604 10/8/2019
1.0.1 580 9/30/2019
1.0.0 591 9/28/2019