- T
- The type.
- obj
- The object on which to perform an action.
Since the compiler can infer the types, you do not need to provide the type, this is typically used with the System.Array.Foreach method or the List's ForEach method.C# Example
// // Simple "echo" implementation // using System; class X { static void Main (string [] args) { Array.ForEach (args, print); Console.WriteLine (); } static void print (string a) { Console.Write (a); Console.Write (" "); } }
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0