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

Detect space in the string and delete it

Status
Not open for further replies.

giahan

Programmer
Sep 1, 2000
139
US
How do I dectect spaces in a string and delete them?
Thank you [sig]<p>GH<br>[/sig]
 
Hi giahan!

here we go:

<CFSET yourString = Replace(yourString,&quot; &quot;,&quot;&quot;,&quot;ALL&quot;)>

will do the job ;-)
Chris [sig][/sig]
 
Trim(string) trims whitespace from both the beginning and the end of a string...there is some other function called replace that might help...but you got to check...the syntax goes like this:
#replace(string, whatstring, withstring [, scope])#
P.S: [optional]
lets say you wanna replace all the occurrences of US in some address string with USA...you write the following:
#replace(address, &quot;US&quot;, &quot;USA&quot;, &quot;ALL&quot;)#
P.S: ALL is for all occurrences
in your case some thing like this might work :)
#replace(string, &quot; &quot;, &quot;&quot;, &quot;ALL&quot;)#
good luck [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top