KD.Linq 1.0.0

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

// Install KD.Linq as a Cake Tool
#tool nuget:?package=KD.Linq&version=1.0.0

KD.Linq


Added LINQ methods

Find:

IEnumerable<int> list = new List<int>() { 1, 2, 3, 1, 2, 3, 1, 1 };
Console.WriteLine(string.Join(", ", list));

// Find all elements which are equal to 1
List<int> ones = list.Find(1);
Console.Write(string.Join(", ", ones));

alternate text is missing from this package README image

For Each (generic):

List<int> list = new List<int>() { 1, 2, 1, 3, 1, 4 };
// Standard ForEach which is include in List class
list.ForEach(value => Console.Write(value + ", "));

Console.WriteLine();

// Generic ForEach made for any Enumerable - Action Version
IEnumerable<int> enumerable = new int[] { 1, 2, 1, 3, 1, 4 };
enumerable.ForEach(value => Console.Write(value + ", ")).ToList();

Console.WriteLine();

// Generic ForEach made for any Enumerable - Function Version
IEnumerable<int> enumerable2 = enumerable.ForEach(value => { return value + 1; }).ToList();
enumerable2.ForEach(value => Console.Write(value + ", ")).ToList();

alternate text is missing from this package README image

Index Of:

Element el1 = new Element() { Value = 1 };
Element el2 = new Element() { Value = 2 };
Element el3 = new Element() { Value = 3 };
Element el4 = new Element() { Value = 4 };

IEnumerable<Element> list = new List<Element>() { el1, el2, el3, el4 };
// Get index of el3 object in current Enumerable
int index = list.IndexOf(el3);

Console.WriteLine("Index = " + index);

alternate text is missing from this package README image

IsEmpty:

IEnumerable<int> list1 = new List<int> { 1, 2, 3 };
Console.WriteLine($"List1 is empty: { list1.IsEmpty() }");

IEnumerable<int> list2 = new List<int> { };
Console.WriteLine($"List2 is empty: { list2.IsEmpty() }");

alternate text is missing from this package README image

Replace At:

List<int> list = new List<int>() { 1, 2, 1, 3, 1, 4 };
Console.WriteLine(string.Join(", ", list));

// Replace value at index 1 to 9
List<int> list2 = list.ReplaceAt(1, 9).ToList();
Console.WriteLine(string.Join(", ", list2));

// Replace value at index 2 to 567
List<int> list3 = list2.ReplaceAt(2, 567).ToList();
Console.WriteLine(string.Join(", ", list3));

alternate text is missing from this package README image

Replace Multiple:

List<int> list = new List<int>() { 1, 2, 1, 3, 1, 4 };
Console.WriteLine(string.Join(", ", list));

// Replace value at each index where value equals 1 to new value which is 9
List<int> list2 = list.ReplaceMultiple(9, value => value == 1).ToList();
Console.WriteLine(string.Join(", ", list2));

// Replace value at each index where value equals 2 to new value which is 8
List<int> list3 = list2.ReplaceMultiple(8, value => value == 2).ToList();
Console.WriteLine(string.Join(", ", list3));

alternate text is missing from this package README image

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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 501 6/3/2020