Well, if you had a full name, i.e. "Allan Mac Donald" and you wanted to
eliminate the 2nd space, you could use
<cfset newname = REReplace(trim(oldname),"([[:alpha:]]+?) +?([[:alpha:]]*?)
([[:alpha:]]+?)$","\1 \2\3")>
Of course, this assumes that there aren't any numbers in the person's
name... if you want to allow digits, just change [:alpha:] to [:alnum:] ...
You could also use [[:space:]]+? instead of the space if you thought there
might be carriage returns in the middle of the name. :)
<OFF_TOPIC>
"As a group or an individual you have the right to be called whatever you
want. Your name can be spelled S-M-I-T-H and pronounced 'jenovsky'. What's
your name? Jenovsky. How's that spelled? S-m-i-t-h. What?! They're all
silent, nevermind..."
-- George Carlin
</OFF_TOPIC>
hth
Isaac Dealey
Certified Advanced ColdFusion 5 Developer
www.turnkey.to
954-776-0046
> Rebecca Joy Sherman writes:
> <cfoutput>#replace("Mac Donald", " ", "", "all")#</cfoutput>
> will work...
> there's probably a regular expression to search for a space...i just don't
> know reg exps :(
> charlie
>> Hi all,
>>
>> Is there a way to get CF to delete the space in between a name. ie...
>> "Mac
>> Donald" to just "MacDonald"?
>>
>>
>> Thanks,
>>
>>
>> Joy
>>
>>
>>
>>
>
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists