Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
删除特定列行多维数组C#_C#_Arrays_Multidimensional Array - Fatal编程技术网

删除特定列行多维数组C#

删除特定列行多维数组C#,c#,arrays,multidimensional-array,C#,Arrays,Multidimensional Array,嗨,有人能帮我删除多维数组吗?这段代码让数组超出了范围 ``` int[,] Arr = { { 10,20,30,40}, { 10,20,30,40}, { 10,20,30,40}, { 10,20,30,40} }; int index = 1; for(int x = 0; x <= 3; x++) { for (int i = index; i < Arr.Length - 1; i++) { Arr[i, x] =

嗨,有人能帮我删除多维数组吗?这段代码让数组超出了范围

```
int[,] Arr = {
  { 10,20,30,40},
  { 10,20,30,40},
  { 10,20,30,40}, 
  { 10,20,30,40}
};

int index = 1;
for(int x = 0; x <= 3; x++) { 
    for (int i = index; i < Arr.Length - 1; i++)
    {

        Arr[i, x] = Arr[i + 1, x];


    }
}
```
```
int[,]Arr={
{ 10,20,30,40},
{ 10,20,30,40},
{ 10,20,30,40}, 
{ 10,20,30,40}
};
int指数=1;

对于(int x=0;x,
Length
属性返回第一个维度的长度。如果要访问其他维度,必须使用
GetLength()
方法。请参阅。

一旦数组初始化,它就会被修复-那么您打算如何从中删除?对于
i
x
的哪些值,您会得到异常?Arr[i,x]=Arr[i+1,x];我认为x是问题所在。我想删除特定行使用列表而不是数组:list>Arr=new list(){new List(){10,20,30,40},new List(){10,20,30,40},new List(){10,20,30,40},new List(){10,20,30,40};