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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace Formula 2

Status
Not open for further replies.

NateUNI

MIS
Jan 3, 2002
132
US
If I have a string like the following:

Security - Better Safe Than Sorry

How would i write a replace statment that will replace anything before the article title to be replaced with a blank space.

IE. The above string would be replaced with "Data Security - Better Safe Than Sorry"

The number following articleID and campaignID can change. IE. right now it is 54 and 26, next time it could be 1 and 1000.
 
Assuming that the http and Data are constant:
Replace ({yourstring}, "http*Data", "Data")

Madawc Williams
East Anglia
Great Britain
 
Mid({String},n) will return the rest of the string starting at n.

Instr({String},"Substring") will return a numeric value for what charcter number the subtring starts at in the full string, the n that we need in your case.

So try this:

Mid({String},instr({String},"SubString"))

It should give you everything to the right of where the subtring starts.


Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
NateUNI - try Mid({String},instr({String},"ArticleTitle=") + 13)

This finds the position at which the string "ArticelTitle=" starts (I am assuming that the string "ArticleTitle=" will always be present), then adds 13 to it to get past the ArticleTitle= string, and picks up whatever it finds from thereon.

Is this what you are after?

Regards

Marc
 
Thats exactly what I was looking for, Thanks alot guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top