简体   繁体   中英

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? Should I just compare the result of myList.length() > 0 , myList.toString() != "" or try another method altogether?

I would go with the simple myList.length() > 0 method.

You can see an example of the length() function in the ECMAScript for XML (E4X) specification (page 104), which Actionscript implements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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