【发布时间】:2022-06-22 07:06:09
【问题描述】:
var team = []
如何判断team是否为空?
我试过了:
if (team){
System.print("List is empty!")
}
但它不起作用,因为它打印了List is empty!。
【问题讨论】:
标签: wren
var team = []
如何判断team是否为空?
我试过了:
if (team){
System.print("List is empty!")
}
但它不起作用,因为它打印了List is empty!。
【问题讨论】:
标签: wren
var team = []
System.print(team.count == 0) // Output: false
System.print(team.isEmpty) // Output: false
【讨论】: