数组得到的最小值大于其他值

Vla*_*adL 5 c# linq

我有以下数组:

float[] arr = { 0, 0.1f, 0, 0.1f, 0, 0.2f };
Run Code Online (Sandbox Code Playgroud)

选择最大值大于0或大于其他值的最优雅方法是什么?

我已经尝试使用Min()Select...From...OrderBy...First(),但没有运气,直到如今.

Rot*_*tem 21

使用LINQ方法Where过滤掉零值,然后使用LINQ方法Min检索生成的集合的最低值.

arr.Where(f => f > 0).Min();
Run Code Online (Sandbox Code Playgroud)