|
Web
News |
Vancouver's a centre of clean technology, book says Vancouver ranks among the Top 10 new "Silicon Valleys" of the clean technology sector worldwide, according to U.S. authors Clint Wilder and Ron Pernick. "Vancouver has emerged as a centre for the fuel cell industry,"...
The Canadian Press signs on to use Nstein... Media software company Nstein Technologies Inc. (TSXV:EIN) announced Monday it has signed a contract with The Canadian Press. Canada's national bilingual multimedia news agency, which delivers content to 85 daily newspapers and more than 500 radio and...
Technology Sales Outsourcing Company opens... Intensify Sales, the tactical sales outsourcing company has opened an office in Toronto, bringing its highly effective sales outsourcing services to the technology companies in Canada. Founded in the UK, Intensify...
Computer comedian is no joke Have you heard the one about the computer that had a sense of humour? This question has never had a real-world punch line – until now. According to news reports, U.S.-based experts in artificial intelligence have created software that can understand simple jokes.
Canadian weather station heads to Mars The Phoenix Mars Lander, a robot explorer with a Canadian weather station aboard, was launched Saturday from Cape Canaveral in Florida, boosted into space on a Delta II rocket. The lander will examine the climate at the north pole of Mars after it arrives next spring.
|
|
 |
|
08.06.07
Coldfusion: Counting Word Instances In A String
By Raymond Camden
Yesterday in the IRC channel someone asked if there was a way to count the number of times each unique word appears in a string.
While it was obvious that this could be done manually (see below), no one knew of a more elegant solution. Can anyone think of one? Here is the solution I used and it definitely falls into the "manual" (and probably slow) category.
First I made my string:
Next I created a structure:
Note that this will be inherently case-insenstive, which I think is a good thing. At this point we are done, but I added some display code as well:
Comments
About the Author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com
Raymond Camden is Vice President of Technology for roundpeg, Inc. A long
time ColdFusion user, Raymond has worked on numerous ColdFusion books
and is the creator of many of the most popular ColdFusion community web
sites. He is an Adobe Community Expert, user group manager, and the
proud father of three little bundles of joy.
|
|