ふらっとC#,C♯,C#(初心者用) Part31
at TECH
401:390
08/10/03 22:27:26
>>400
valuesじゃ駄目だろうか?
public static class IEnumerableExtensions {
public static void Each<T>(this IEnumerable<T> values, Action<T> action) {
foreach (T obj in values) { action(obj); }
}
public static void EachWithIndex<T>(this IEnumerable<T> values, Action<T, int> action){
int index = 0;
foreach (T obj in values){
action(obj, index++);
}
}
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5377日前に更新/215 KB
担当:undef