Pattern matching how you can use the “when” keyword

前端 未结 0 885
青春惊慌失措
青春惊慌失措 2020-12-31 16:20

This is my sampler:

object[] input = new object[] {1, "", 2.3, 5, 8 };
int sum = 0;
foreach (var item in input)
{
    if (item is int count)
    sum         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题