Class ArrayUtil
Utility class for array operations.
public static class ArrayUtil
- Inheritance
-
ArrayUtil
- Inherited Members
Methods
GetColumn<T>(T[,], int)
Extracts a column from a 2D array.
public static T[] GetColumn<T>(this T[,] src, int columnIndex)
Parameters
src
T[,]The source 2D array
columnIndex
intThe index of the column to extract
Returns
- T[]
A 1D array containing the elements of the specified column
Type Parameters
T
The type of elements in the array
GetRow<T>(T[,], int)
Extracts a row from a 2D array.
public static T[] GetRow<T>(this T[,] src, int rowIndex)
Parameters
src
T[,]The source 2D array
rowIndex
intThe index of the row to extract
Returns
- T[]
A 1D array containing the elements of the specified row
Type Parameters
T
The type of elements in the array
GetRows<T>(T[,])
Converts a 2D array to a jagged array of rows.
public static T[][] GetRows<T>(this T[,] src)
Parameters
src
T[,]The source 2D array
Returns
- T[][]
A jagged array where each inner array represents a row from the source array
Type Parameters
T
The type of elements in the array