It's not often CF suprises me, but this is one of them!
-----Original Message-----
From: Tim Blair [mailto:[EMAIL PROTECTED]
Sent: 23 September 2004 15:55
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] number of items in a list
> list.split(",") << am I missing something, where did this
> come from?
That's a "since MX" thing -- because all basic types in CF are treated
(at least initially) as Java strings, you can use functions from the
java.lang.String class [1], which includes a function to "tokenise" a
string into an array given a certain token (in this case a comma).
In this case, the split() method [2] can actually perform the split on
more than a single character -- it takes a regular expression as the
delimiter. It also acts differently as the CF list functions in that is
*doesn't* ignore empty items.
You can use other methods the String class to good effect too: I've used
functions like charAt(), compareTo(), startsWith(), endsWith() and
matches().
Ah the joys of CF sitting on top of Java... ;)
Tim.
--
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by
activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*
To unsubscribe, e-mail: [EMAIL PROTECTED]