在coldfusion的情况下,structKeyExists是否敏感?

Yoo*_*lla 1 coldfusion key case-sensitive data-structures

一个简单的查询,如果structKeyExists()coldfusion中使用的函数是区分大小写的,或者不是关于它的'key'.我没有找到一个直接的答案,想在这里发布

Yoo*_*lla 7

如果对coldfusion中的structKeyExists是区分大小写或者不关注它的关键,那么这只是我的2美分有点圆满的答案.通常的搜索没有给我任何直接的答案,所以在这里.不是它不区分大小写.那是:

<cfset foo={}>
<cfset structinsert(foo,"Yoosaf","Boy") />
<cfif structKeyExists(foo,"YOOSAF")>
  <cfoutput>#foo.yoosaf#</cfoutput>
</cfif>
<cfif structKeyExists(foo,"yOOSAF")>
  <cfoutput>#foo.yoosaf#</cfoutput>
</cfif>
Run Code Online (Sandbox Code Playgroud)

IF条件都将返回true

我希望这有帮助

  • 第一次在这样的场景上工作,你的答案节省了我的时间. (2认同)