> Not sure how you tested this
Define a variable representing a number as a double:
<cfset y = val("15")>
<cfset arr = [y]>
Now run indexOf("15"). The value is not found because unlike CF functions, java
lists also consider data type when determining element equality.
15 = #arr.indexOf("15")# ==> -1 / not found
y = #arr.indexOf(y)# ==> 0 / found
> It returns the index of the value, secondly if you wish to do a case
> insenstive index then it is still possible.
Well my point was not that it is _not_ possible ;-) It was that indexOf is not
a straight equivalent of CF9's array functions. So before using it, be aware
of these two differences.
> public boolean function containsIgnoreCase(required array arrayList,
> var it = arrayList.iterator();
> while(it.hasNext()) {
Honestly, I do not see the benefit of down to the java level for this. If you
are going to end up looping anyway, may as well use a native cfloop
array="...". It is
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:350996
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm