Re: String to List?

2009-03-20 Thread Christophe Maso
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

Re: String to List?

2009-03-20 Thread Dominic Watson
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

RE: String to List?

2009-03-20 Thread Dawson, Michael
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

RE: String to List?

2009-03-20 Thread Adrian Lynch
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

Re: String to List?

2009-03-20 Thread Christophe Maso
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

Re: String to List?

2009-03-20 Thread Christophe Maso
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

Re: String to List?

2009-03-20 Thread Dominic Watson
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

Re: String to List?

2009-03-19 Thread Charlie Griefer
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

Re: String to List?

2009-03-19 Thread Yuliang Ruan
#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

RE: String to List?

2009-03-19 Thread Adrian Lynch
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

Re: String to List?

2009-03-19 Thread Peter Boughton
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

Re: String to List?

2009-03-19 Thread Charlie Griefer
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

Re: String to List?

2009-03-19 Thread Peter Boughton
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

Re: String to List?

2009-03-19 Thread Dominic Watson
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

RE: String to List?

2009-03-19 Thread Adrian Lynch
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

Re: String to List?

2009-03-19 Thread Charlie Griefer
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

Re: String to List?

2009-03-19 Thread Peter Boughton
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

Re: String to List?

2009-03-19 Thread Wil Genovese
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. :)

Re: String to List?

2009-03-19 Thread Dominic Watson
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

Re: String to List?

2009-03-19 Thread Christophe Maso
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.

RE: String to List?

2009-03-19 Thread Adrian Lynch
-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

Re: string to list???

2000-05-03 Thread KChapman
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

RE: string to list???

2000-05-03 Thread Steve Reich
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

RE: string to list???

2000-05-03 Thread Nagesh Kumar Deva
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