Re: Split String
First my earlier post completely disregarded the fact that you'd have "/" chars BEFORE the .cfm, so sorry about neglecting that tid bit. Secondly I'd like to recommend not using so many #'s where they aren't needed. I've worked the code below to illustrate what I mean. Also, to avoid #'s on the left hand side of assignment as well as reducing the use of evaluate I'd recommend using either a struct or an array for storing your "url_var" vars. Variable#i# = #ary_vars[i]# No / delimited variables found in URL string ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339864 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Split String
How is that any different to listGetAt(list, 2, '.cfm/') and its shorter code. Regards, Andrew Scott http://www.andyscott.id.au/ > -Original Message- > From: Larry Lyons [mailto:larrycly...@gmail.com] > Sent: Tuesday, 7 December 2010 9:01 AM > To: cf-talk > Subject: Re: Split String > > > I'd use CF's underlying java core in this case, as in: > > "thislocation/thisdir/thissite/thispage.cfm/var1/var2/var3/var4" > theOtherPart = theList.split(".cfm") /> /> > > > > > > > hth, > larry > > > I have a string like this: thislocation/thisdir/thissite/thispage. > > cfm/var1/var2/var3/var4 > > > > I want to split the string to get just that data that follows ".cfm/", > > which would be var1/var2/var3/var4. > > > > Tried all the list function I can think of, but that's not the right > > approach. How can all get only the data that follows the literal ". > > cfm/"? > > > > Thanks > > > > > > Robert B. Harrison > > Director of Interactive Services > > Austin & Williams > > 125 Kennedy Drive, Suite 100 > > Hauppauge NY 11788 > > P : 631.231.6600 Ext. 119 > > F : 631.434.7022 > > http://www.austin-williams.com > > > > Great advertising can't be either/or. It must be &. > > > > Plug in to our blog: A&W Unplugged > > http://www.austin-williams.com/unplugged > > > > > > > ~~ > ~~~| > Order the Adobe Coldfusion Anthology now! > http://www.amazon.com/Adobe-Coldfusion- > Anthology/dp/1430272155/?tag=houseoffusion > Archive: http://www.houseoffusion.com/groups/cf- > talk/message.cfm/messageid:339851 > Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm > Unsubscribe: http://www.houseoffusion.com/groups/cf- > talk/unsubscribe.cfm ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339857 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Split String
I'd use CF's underlying java core in this case, as in: hth, larry > I have a string like this: thislocation/thisdir/thissite/thispage. > cfm/var1/var2/var3/var4 > > I want to split the string to get just that data that follows ".cfm/", > which would be var1/var2/var3/var4. > > Tried all the list function I can think of, but that's not the right > approach. How can all get only the data that follows the literal ". > cfm/"? > > Thanks > > > Robert B. Harrison > Director of Interactive Services > Austin & Williams > 125 Kennedy Drive, Suite 100 > Hauppauge NY 11788 > P : 631.231.6600 Ext. 119 > F : 631.434.7022 > http://www.austin-williams.com > > Great advertising can't be either/or. It must be &. > > Plug in to our blog: A&W Unplugged > http://www.austin-williams.com/unplugged > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339851 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Split String
> listrest(listlast(thestring, "."), "/\") should give you 'var1/var2/var3/var4' This seems to be working. Thanks for the assist. Now I'll share the results. What I wanted to do was break any url containing obfuscated vars into into elements I could work with for queries, etc. This now seems to be working to do just that, regardless of the URL structure. Now I can use urls like ... http://mypage.cfm/var1/var2/var3 instead of urls like http://mypage.cfm?var1=value1&var2=value2&var3=value3 Much better for SEO. Variable#i#=#evaluate("url_var#i#")# No / delimited variables found in URL string Robert B. Harrison Director of Interactive Services Austin & Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be &. Plug in to our blog: A&W Unplugged http://www.austin-williams.com/unplugged ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339817 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Split String
I love that about this list.. you can always learn something new.. I used: #foo# On Mon, Dec 6, 2010 at 9:23 AM, Rick Root wrote: > > How about this... > > > > seems to work. > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339815 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Split String
How about this... seems to work. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339814 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Split String
ListRest(yourList,"/") ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339813 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Split String
listrest(listlast(thestring, "."), "/\") should give you 'var1/var2/var3/var4' Azadi On 06/12/2010 23:06 , Robert Harrison wrote: > I have a string like this: > thislocation/thisdir/thissite/thispage.cfm/var1/var2/var3/var4 > > I want to split the string to get just that data that follows ".cfm/", which > would be var1/var2/var3/var4. > > Tried all the list function I can think of, but that's not the right > approach. How can all get only the data that follows the literal ".cfm/"? > > Thanks > > > Robert B. Harrison > Director of Interactive Services > Austin& Williams > 125 Kennedy Drive, Suite 100 > Hauppauge NY 11788 > P : 631.231.6600 Ext. 119 > F : 631.434.7022 > http://www.austin-williams.com > > Great advertising can't be either/or. It must be&. > > Plug in to our blog: A&W Unplugged > http://www.austin-williams.com/unplugged > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339812 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Split String
I have a string like this: thislocation/thisdir/thissite/thispage.cfm/var1/var2/var3/var4 I want to split the string to get just that data that follows ".cfm/", which would be var1/var2/var3/var4. Tried all the list function I can think of, but that's not the right approach. How can all get only the data that follows the literal ".cfm/"? Thanks Robert B. Harrison Director of Interactive Services Austin & Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 P : 631.231.6600 Ext. 119 F : 631.434.7022 http://www.austin-williams.com Great advertising can't be either/or. It must be &. Plug in to our blog: A&W Unplugged http://www.austin-williams.com/unplugged ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339811 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm