Skip to content

Instantly share code, notes, and snippets.

@baba-s
Last active February 27, 2019 04:54
Show Gist options
  • Save baba-s/9409574 to your computer and use it in GitHub Desktop.
Save baba-s/9409574 to your computer and use it in GitHub Desktop.
using System;
/// <summary>
/// 配列の拡張メソッドを管理するクラス
/// </summary>
public static partial class ArrayExtensions
{
/// <summary>
/// 指定された配列内の各要素に対して、指定された処理を実行します
/// </summary>
/// <typeparam name="T">配列要素の型</typeparam>
/// <param name="array">要素に処理を適用する、インデックス番号が 0 から始まる 1 次元の Array</param>
/// <param name="action">array の各要素に対して実行する Action<T></param>
public static void ForEach<T>(this T[] array, Action<T> action)
{
Array.ForEach<T>(array, obj => action(obj));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment