Everything is a List in ColdFusion!
Ok, maybe not everything, but alot of things are. I've recently come across a several situations that reminded me how great lists are, particularly in a loosely typed language like ColdFusion. There are tons of things that can be treated like a list in ColdFusion. Here's a short list of some of my favorites:
- Sentences are lists of words delimited by spaces.
- Lines of a page are lists delimited by a Carriage Return/Line Feed (CRLF).
- Paragraphs are lists delimited by a pair of CRLFs.
- File paths are lists delimited by forward or backward slashes. Use listLast() to grab the filename or listFirst() to grab the drive letter (windows).
- File names are lists delimited by a period. Use listLast() to get the file's extension.
- Decimal numbers are lists delimited by a period. Use listFirst() or listLast() to separate out the whole number or fraction.

Now I will stress that listFunctions can be pretty slow. For your example of treating a file as a list - that is ok, but normally I'd use listToArray to translate the file and then I'd loop over the array. This can result in significant performance gains.
# Posted By Raymond Camden | September 17, 2004 5:00 AM
# Posted By dave ross | September 17, 2004 5:55 AM
But you post a good point, you can save a lot of time when you parse data as lists.
# Posted By Pete Freitag | September 17, 2004 7:48 AM
# Posted By Ms. Dark | September 26, 2004 1:26 AM