If (Array.Length == 0)

后端 未结 12 1999
耶瑟儿~
耶瑟儿~ 2020-12-23 11:23

If an array is empty, it looks like you can\'t check it\'s length using \".length\". What\'s the best way to check if an array is empty?

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-23 11:56

    This is the best way. Please note Array is an object in NET so you need to check for null before.

提交回复
热议问题