简体   繁体   English

如何在Flex中检查XMLList是否为空

[英]How to check if an XMLList is empty in Flex

If I have an XMLList object in Flex, what is the proper way to check to see if the list is empty? 如果我在Flex中有一个XMLList对象,检查列表是否为空的正确方法是什么? Should I just compare the result of myList.length() > 0 , myList.toString() != "" or try another method altogether? 我应该只比较myList.length() > 0myList.toString() != ""还是尝试另一种方法?

I would go with the simple myList.length() > 0 method. 我会使用简单的myList.length() > 0方法。

You can see an example of the length() function in the ECMAScript for XML (E4X) specification (page 104), which Actionscript implements. 您可以在ActionsScript实现ECMAScript for XML(E4X)规范 (页面104)中看到length()函数的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM