You've gotta love this bit of code:
REreplace(arguments.strInputString,(.)(.),\1#arguments.strDelimiter#\2#ar
guments.strDelimiter#,ALL)
lol
Oh come on, that's funny! :OD
Yeah, I know. :) I haven't added regex to my knowledge repertoire yet, so I
just modified the code snippet offered in
I'd be interested to know how the code I suggested performs in
comparison to the regex with the 360k string - in theory it outperform
it:
cfset myList = ArrayToList( myString.toCharArray() ) /
Regex seems a little ott in this situation.
I created a string 360k chars long for testing - this
Are you referring to the ASCII breasts?
Thanks,
Mike
-Original Message-
From: Adrian Lynch [mailto:cont...@adrianlynch.co.uk]
Sent: Thursday, March 19, 2009 6:20 PM
To: cf-talk
Subject: RE: String to List?
You've gotta love this bit of code:
REreplace(arguments.strInputString
Ermm, no, I thought they looked like eyes! :OD
-Original Message-
From: Dawson, Michael [mailto:m...@evansville.edu]
Sent: 20 March 2009 13:31
To: cf-talk
Subject: RE: String to List?
Are you referring to the ASCII breasts?
Thanks,
Mike
-Original
I'd be interested to know how the code I suggested performs in
comparison to the regex with the 360k string - in theory it
outperform
it:
cfset myList = ArrayToList( myString.toCharArray() ) /
Running on CF8, I used cftimer to test execution time on a string 360K long
(all
I just noticed that listFromChars() is essentially 1 line of code, also. My
bad...
Bottom line for me is to learn regex and more Java!
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Interesting stuff - vodoo regex wonders :)
Dominic
Running on CF8, I used cftimer to test execution time on a string 360K long
(all alphanumerics, just alphabet appended with 1 to 0 and concatenated
10,000 times). No cfdump or output; just a cfset statement.
My original function - over
Nope. any character can be a delimiter. you can consider the 'c' in
'abcdef' a delimiter between 'ab', and 'def'. But yeah, there has to be a
delimiter.
I don't think there's a way to do it other than what you've come up with...
looping over the string and inserting the desired delimiter.
Of
#REreplace(list,(.)(.),\1,\2,,ALL)#
heh...not technically list manipulation
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
Dip into Java first maybe then back to CF?
cfset str = abcdefg
cfset arr = str.split()
cfdump var=#arr#
!--- cfset ArrayDeleteAt(arr, 1) ---
cfset str = ArrayToList(arr, ,)
cfdump var=#str#
Note the the first element in the array is an empty string. I thought
ArrayDeleteAt() would take care
Of course, this is usually where somebody proves me wrong and posts
something really cool
My pleasure... ;)
cffunction name=ListFromChars returntype=String output=false
cfargument name=Text type=String/
cfargument name=Delimiter type=String default=,/
cfreturn
Had to look up what the \B represented.
\B matches at any position between two word characters as well as at any
position between two non-word characters.
holy crap that is really cool :)
On Thu, Mar 19, 2009 at 3:11 PM, Peter Boughton bought...@gmail.com wrote:
Of course, this is usually
holy crap that is really cool :)
Yep. :)
For a full explanation of the last regex there:
\B|(?!^)\b(?!$)
Summarised as Any char boundary that is not at the start or end of the text.
In detail...
\B # as above, any WordChar-WordChar or NonWordChar-NonWordChar boundary.
| # or (not
This also does it quite nicely:
cfset list = ArrayToList( myString.toCharArray() ) /
Dominic
2009/3/19 Peter Boughton bought...@gmail.com:
holy crap that is really cool :)
Yep. :)
For a full explanation of the last regex there:
\B|(?!^)\b(?!$)
Summarised as Any char boundary that is
I knew there'd be something in Java!
-Original Message-
From: Dominic Watson [mailto:watson.domi...@googlemail.com]
Sent: 19 March 2009 22:03
To: cf-talk
Subject: Re: String to List?
This also does it quite nicely:
cfset list = ArrayToList( myString.toCharArray
holy crap that is really cool :)
On Thu, Mar 19, 2009 at 3:02 PM, Dominic Watson
watson.domi...@googlemail.com wrote:
This also does it quite nicely:
cfset list = ArrayToList( myString.toCharArray() ) /
Dominic
2009/3/19 Peter Boughton bought...@gmail.com:
holy crap that is really
This also does it quite nicely:
cfset list = ArrayToList( myString.toCharArray() ) /
And far more efficiently too!
You win. :)
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the
So many cool ways and only one cat to skin ;-)
Wil
2009/3/19 Peter Boughton bought...@gmail.com
This also does it quite nicely:
cfset list = ArrayToList( myString.toCharArray() ) /
And far more efficiently too!
You win. :)
Hoorah!
2009/3/19 Peter Boughton bought...@gmail.com:
This also does it quite nicely:
cfset list = ArrayToList( myString.toCharArray() ) /
And far more efficiently too!
You win. :)
~|
Adobe® ColdFusion® 8 software 8 is
Thanks all! Good stuff all around...really must get myself locked onto regex
one of these days :).
I came up with this:
cffunction name=stringToDelimListRE access=public returnType=string
output=false hint=Takes a string argument and inserts the second argument
between each character.
-talk
Subject: Re: String to List?
Thanks all! Good stuff all around...really must get myself locked onto
regex one of these days :).
I came up with this:
cffunction name=stringToDelimListRE access=public
returnType=string output=false hint=Takes a string argument and
inserts
Can you give an example of what your trying to do?
Like: "I'm trying to turn 1,2,3 into 123"
--Katrina
Katrina Chapman
Consultant
Ameriquest Mortgage
You can have a list with a space as the delimeter. If you have punctuation
or double spaces you would simply do a replace on them with a single space.
HTH,
Steve
-Original Message-
From: Nagesh Kumar Deva [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 03, 2000 12:06 PM
To: Cold Fusion
Thanx josh
now it is working fine
bai
nagesh
-Original Message-
From: Josh Black [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 04, 2000 12:39 AM
To: [EMAIL PROTECTED]
Subject: Re: string to list???
Any string with spaces in it can automatically be treated as a space
delimited list
24 matches
Mail list logo