MliybsToolKit 1.0.4
See the version list below for details.
dotnet add package MliybsToolKit --version 1.0.4
NuGet\Install-Package MliybsToolKit -Version 1.0.4
<PackageReference Include="MliybsToolKit" Version="1.0.4" />
<PackageVersion Include="MliybsToolKit" Version="1.0.4" />
<PackageReference Include="MliybsToolKit" />
paket add MliybsToolKit --version 1.0.4
#r "nuget: MliybsToolKit, 1.0.4"
#:package MliybsToolKit@1.0.4
#addin nuget:?package=MliybsToolKit&version=1.0.4
#tool nuget:?package=MliybsToolKit&version=1.0.4
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 | Versions 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. |
-
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.