tag:blogger.com,1999:blog-19056005.post8885166728026348714..comments2023-08-01T04:33:41.114-07:00Comments on Coldfused?: ListToArray with empty elementsRupesh Kumarhttp://www.blogger.com/profile/11403172559407967918noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-19056005.post-30621775688881924212007-07-25T09:12:00.000-07:002007-07-25T09:12:00.000-07:00You are right.. Somehow split(",", -1) works on Co...You are right.. Somehow split(",", -1) works on ColdFusion 8 but not on 7. <BR/><BR/>It will work fine if you change that to <BR/>split(",", javacast("int", -1))<BR/><BR/>Let me know if that works for you.Rupesh Kumarhttps://www.blogger.com/profile/11403172559407967918noreply@blogger.comtag:blogger.com,1999:blog-19056005.post-21560519519765386392007-07-24T20:46:00.000-07:002007-07-24T20:46:00.000-07:00When I tried your code, I get this error:The selec...When I tried your code, I get this error:<BR/><BR/>The selected method split was not found. Either there are no methods with the specified method name and argument types, or the method split is overloaded with arguments types that ColdFusion can't decipher reliably. If this is a Java object and you verified that the method exists, you may need to use the javacast function to reduce ambiguity.<BR/><BR/>Will this work on CF 7?The Luxeshttps://www.blogger.com/profile/17654677100559844292noreply@blogger.comtag:blogger.com,1999:blog-19056005.post-86991839600247825452007-06-07T12:04:00.000-07:002007-06-07T12:04:00.000-07:00Thanks to Andrew Clark for the tip that split(",",...Thanks to Andrew Clark for the tip that split(",", -1) does the trick. Changed the code above to use the correct method which takes care of empty elements in the list.Rupesh Kumarhttps://www.blogger.com/profile/11403172559407967918noreply@blogger.comtag:blogger.com,1999:blog-19056005.post-68199892492685852412007-06-02T09:36:00.000-07:002007-06-02T09:36:00.000-07:00I posted another entry here which has an UDF whic...I posted another entry <A HREF="http://coldfused.blogspot.com/2007/06/listtoarray-with-empty-elements-part-ii.html" REL="nofollow">here </A> which has an UDF which does the same.Rupesh Kumarhttps://www.blogger.com/profile/11403172559407967918noreply@blogger.comtag:blogger.com,1999:blog-19056005.post-21877086038777224582007-06-02T08:00:00.000-07:002007-06-02T08:00:00.000-07:00@charlieoh ya.. you are right.. split() does not c...@charlie<BR/>oh ya.. you are right.. split() does not consider the empty elements at the end of the list.<BR/><BR/>Since split() takes a regular expression, I think it should be possible to get it right. As I am not an expert in reg-ex, I tried doing it regular way and will post it in a separate post. I will ask some reg-ex experts in the team if we can get a simple reg-ex for this.Rupesh Kumarhttps://www.blogger.com/profile/11403172559407967918noreply@blogger.comtag:blogger.com,1999:blog-19056005.post-4469276408911855442007-06-01T13:35:00.001-07:002007-06-01T13:35:00.001-07:00ok let's try that again with a tinyurl :)http://ti...ok let's try that again with a tinyurl :)<BR/><BR/>http://tinyurl.com/3cssfccharlie grieferhttps://www.blogger.com/profile/13276260341871783634noreply@blogger.comtag:blogger.com,1999:blog-19056005.post-67895659452986482492007-06-01T13:35:00.000-07:002007-06-01T13:35:00.000-07:00hi rupesh:i blogged this a little while back (http...hi rupesh:<BR/><BR/>i blogged this a little while back (http://cfblog.griefer.com/index.cfm/id/make_like_a_banana_and_split), and it was pointed out (accurately) in the comments that this method won't work if the LAST list element is empty.<BR/><BR/>any workaround for that?<BR/><BR/>thanks!<BR/>charliecharlie grieferhttps://www.blogger.com/profile/13276260341871783634noreply@blogger.com