Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grab something out of a string 1

Status
Not open for further replies.

evergreean

Technical User
Feb 15, 2006
68
US
How can I fetch something in a string? Below takes the part I want out. But I want to take the part
I want out and then output it:

For example if I have a string such as: (hello)<h2>@ information
then I want grab just this part: <h2>@
and output it just by it self:
<h2>@

My attempt does the opposite and strips the <h2>@ out of the string:

Code:
<cfset theData = "(hello)<h2>@ information">
<cfset wrd = ReReplace(theData, "<h2>@", "", "All")>
<cfoutput>#wrd#</cfoutput>

gives me output of: (hello) information

Please advise.
 
I should also mention that sometimes my string will have a different phrase in front of the <h2>@

It might look like this:

dataherenowh2>@ information

or like this:

more info here<h2>@ information


Please advise.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top