using System;
namespace Core.Util
{
/// <summary>
/// 循环帮助类
/// </summary>
public class LoopHelper
{
/// <summary>
/// 循环指定次数
/// </summary>
/// <param name="count">循环次数</param>
/// <param name="method">执行的方法</param>
public static void Loop(int count,Action method)
{
for (int i = 0; i < count; i++)
{
method();
}
}
/// <summary>
/// 循环指定次数
/// </summary>
/// <param name="count">循环次数</param>
/// <param name="method">执行的方法</param>
public static void Loop(int count, Action<int> method)
{
for (int i = 0; i < count; i++)
{
method(i);
}
}
}
}
(精华)2020年6月26日 C#类库 循环执行帮助类
猜你喜欢
转载自blog.csdn.net/aa2528877987/article/details/106969816
今日推荐
周排行