Skip to main content
Known Participant
December 15, 2006
Question

cfcomponent help!

  • December 15, 2006
  • 4 replies
  • 752 views
Hi,

I need to convert form fields (strings) into tokens. Is there any function in coldfusion to do that? thanks
This topic has been closed for replies.

4 replies

Participating Frequently
December 15, 2006
Ron,

Click on the documentation links that Adam posted.

Read about lists.

Treat your string as a space-delimited list.
RonFusionAuthor
Known Participant
December 15, 2006
Kronin - Here is the problem...I had already read about the lists, but the thing is that the string..is just not with spaces, its a form and a user can enter any delimiters they want. I cannot just specify one delimiter and convert into tokens. that's the issue
Inspiring
December 16, 2006
Use java, then you can break the words with regex:-
Inspiring
December 15, 2006
I could probably figure it out if I knew what a token is.
RonFusionAuthor
Known Participant
December 15, 2006
Hi Don - Basically..if there is any string 'This is a test, this is a test', sepearting out each word would turn into a token.

For ex: this
is
a
test

thanks!
Inspiring
December 15, 2006
quote:

Originally posted by: RonFusion
Hi Don - Basically..if there is any string 'This is a test, this is a test', sepearting out each word would turn into a token.

For ex: this
is
a
test

thanks!

You want all the distinct words in the string separated by two carraige returns? If the string was "this is a test but that is not a test", what would your token be?
Inspiring
December 15, 2006
> Yes.

Hehhehheh.

Maybe trying to read the docs could help. Here's a place to start:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000369.htm

And maybe here:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000364.htm

--
Adam
RonFusionAuthor
Known Participant
December 15, 2006
Does anyone know exactly which function can be used to convert string into tokens.
December 15, 2006
Yes.