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

发布于 2024-08-08 19:44:53 字数 134 浏览 14 评论 0 原文

如果我在 Flex 中有一个 XMLList 对象,检查列表是否为空的正确方法是什么?我应该只比较 myList.length() > 的结果吗? 0、myList.toString() != "" 还是完全尝试其他方法?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

关于从前 2024-08-15 19:44:53

我会选择简单的 myList.length() > 0 方法。

您可以在 ECMAScript for XML (E4X) 规范(第 104 页),Actionscript 实现该规范。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文