Is this pattern matching expression equivalent to not null

后端 未结 2 921
小鲜肉
小鲜肉 2021-01-22 07:33

I stumbled upon this code on github:

if (requestHeaders is {})

and I don\'t understand what it does exactly.

Upon experimenting it\'s s

2条回答
  •  攒了一身酷
    2021-01-22 08:02

    you should be able to do like below..

    Input : str  = null         // initialize by null value
            String.IsNullOrEmpty(str)
    Output: True
    
    Input : str  = String.Empty  // initialize by empty value
            String.IsNullOrEmpty(str)
    Output: True
    

    So based on True false you can get results.

提交回复
热议问题