【问题标题】:How do I compare attribute to a lower case value?如何将属性与小写值进行比较?
【发布时间】:2015-07-17 02:04:33
【问题描述】:

如何创建属性值为小写的过滤器?

这行得通:

xmlItem = xml.*.(attribute("name")==propertyName);

但这会引发错误:

xmlItem = xml.*.(attribute("name").toLowerCase()==propertyName);

【问题讨论】:

    标签: xml actionscript-3 e4x


    【解决方案1】:

    看来我必须使用 toString() 来获取 String 对象,然后我可以使用 toLowerCase():

    var xmlList:XMLList = xml.*.(attribute("name").toString().toLowerCase()==lowerCasePropertyName);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-09
      相关资源
      最近更新 更多