If (Array.Length == 0)

后端 未结 12 1968
耶瑟儿~
耶瑟儿~ 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 12:04

    You can use .Length == 0 if the length is empty and the array exists, but are you sure it's not null?

提交回复
热议问题