MliybsToolKit 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package MliybsToolKit --version 1.0.4
                    
NuGet\Install-Package MliybsToolKit -Version 1.0.4
                    
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="MliybsToolKit" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MliybsToolKit" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="MliybsToolKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MliybsToolKit --version 1.0.4
                    
#r "nuget: MliybsToolKit, 1.0.4"
                    
#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.
#:package MliybsToolKit@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MliybsToolKit&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=MliybsToolKit&version=1.0.4
                    
Install as a Cake Tool

MliybsToolKit

Mliybs的C#扩展工具包 写了一堆逆天类和逆天扩展方法

使用dotnet add package MliybsToolKit安装此包

扩展方法

整型(非负数)

GetEnumerator()

为整型扩展了GetEnumerator方法 有了该方法后整型就可以使用foreach进行遍历 具体作用相当于产生一个0到该整型的整数集合

示例代码:

using System;
using Mliybs.MliybsToolKit;

namespace Namespace
{
    class Program
    {
        public static void Main(string[] args)
        {
            foreach (var item in 5) Console.WriteLine(item);
        }
    }
}

输出结果:0 1 2 3 4 5

Count()和Get()

Count()和Get()可以看做是上述集合的方法 用来获得该集合的元素数量和特定位置的元素

不会真的有人连这个都要用特定的方法吧 虽然我是这么说的但我还是完完整整实现了一边没有偷懒

元组

GetEnumerator

为ValueTuple<int begin, int end>和ValueTuple<int begin, int end, int step>扩展了GetEnumerator方法 可以进行遍历 其中begin表示起始值 end表示结束值 step表示步长 指每隔几个值进行取值 不可为0 可为负

示例代码:

using System;
using Mliybs.MliybsToolKit;

namespace Namespace
{
    class Program
    {
        public static void Main(string[] args)
        {
            foreach (var item in (20, 5, -3)) Console.WriteLine(item);
        }
    }
}

输出结果:20 17 14 11 8 5

Count()和Get()

同上 Count()和Get()可以看做是上述集合的方法 用来获得该集合的元素数量和特定位置的元素

这个我觉得还有点用 比那个0到n都要靠专门方法来计算的强多了

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • 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.9 385 5/1/2023
1.0.8 304 4/25/2023
1.0.7 290 4/25/2023
1.0.6 283 4/24/2023
1.0.5 315 4/5/2023
1.0.4 310 4/5/2023
1.0.3 303 4/5/2023
1.0.2 296 4/5/2023
1.0.1 309 4/5/2023
1.0.0 320 4/5/2023