小编sui*_*uan的帖子

如何使用ConvertAll()转换多级数组?

我想像这样使用ConvertAll:

 var sou = new[,] { { true, false, false }, { true, true, true } };
 var tar = Array.ConvertAll<bool, int>(sou, x => (x ? 1 : 0));
Run Code Online (Sandbox Code Playgroud)

但是我遇到了编译错误:

不能隐式转换类型bool [ , ]到bool []

c#

2
推荐指数
1
解决办法
416
查看次数

标签 统计

c# ×1