Solved

Coldfusion split string

Posted on 2012-03-17
5
586 Views
Last Modified: 2012-03-17
hello experts i need help to split a string
My url string is like:
http://www.test1.com/showimage.cfm?imageurl=http://www.test2.com/image?id=1234&group=5678

looking for url.imageurl i will get:http://www.test2.com/image?id=1234
So i think i need to split the string to get only the second part (after "imageurl="):
http://www.test2.com/image?id=1234&group=5678

Any help?
0
Comment
Question by:Panos
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 37732798
<cfset theURL = "http://www.test1.com/showimage.cfm?imageurl=http://www.test2.com/image?id=1234&group=5678">

If you feel that there will only be one query string parameter on this url, then you can grab it easily by looking for the equals sign...

<cfset imageURL = listLast(theURL,"=")>

Note that if you try to use this full address as a link, you will have trouble unless you escape it.. there are two ?s and the &group will be considered a second parameter, not part of imageURL

http://www.test1.com/showimage.cfm?imageurl=http://www.test2.com/image?id=1234&group=5678
0
 
LVL 2

Author Comment

by:Panos
ID: 37732827
Hi gdemaria.
I need to grab in this case  this:
http://www.test2.com/image?id=1234&group=5678
(it could be :
http://www.test1.com/showimage.cfm?imageurl=http://www.test2.com/image/blablabla.jpg. in this case  i need :http://www.test2.com/image/blablabla.jpg)

generally i need to grad all the text next to imageurl=
listlast doesn't work
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 37732836
Sorry, it should have been listRest(theURL,"=") , not listLast.
0
 
LVL 2

Author Comment

by:Panos
ID: 37732855
Yes.
This is working
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 37732858
thank you
regards
panos
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ColdFusion Web Service/WSDL Connection Issue 2 89
Refreshing ColdFusion Page with Selected Value 8 69
Build PDF in coldfusion 2 63
RETURN INFORMATION FROM COLDFSION CFC 1 63
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now