Solved

Coldfusion split string

Posted on 2012-03-17
5
601 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

636 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