Techies–
I think I’m defining this static extension correctly for Split, I obviously am not because the message: Extension method must be defined in a non-generic static class.
This is a simple c# console program to test something. Here’s what I have:
class Program
{
static int Main(string[] args)
{
int[] numbers = new int[10000];
for (int i = 0; i < numbers.Length; ++i)
numbers[i] = i;
int[][] sectionedNumbers = numbers.Split(1000);
.
. //blah blah blah .. rest of code
return 0;
}
public static T[][] Split<T>(this T[] arrayIn, int length)
{
bool even = arrayIn.Length % length == 0;
.
.
. // blah blah .. more code
return newArray;
}
What is it that I’m doing incorrectly?
Hello your container class must be static
Set you method in static class