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

Replace a dash with a empty space

Status
Not open for further replies.

DrumAt5280

Technical User
Sep 8, 2003
194
US
I can't remember how to do this. I think there is some sort of "FindReplace" CF tag that will allow my to make a city like:

"Fort-Wayne"

and turn it in to:

"Fort Wayne"

I think i might be able to figure that one out myself, however how would i do a city that is really long like this one in California:

"Cardif-By-The-Sea"

I am guessing this that three dashes is the worst case that will be pulled from my database. Is it done with a FindReplace within a loop or something?

So i guess it would go something like this:
1. Query DB, check if returned city has a dash in it.
2. If it does have a dash, find out how many it has.
3. Then replace the dash with a space and loop if more
4. Set the city to it's new variable.

Am i close? I am new at this.
 
<cfset cNewCity=Replace(Form.City,'-',' ','All')>

Should do it.

Lyndon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top