To add to Dick's point, some people's surnames actually are two words. One case in point is CF-Talk regular Jochem van Dieten. I wouldn't want anyone arbitrarily changing my name like that.
> -----Original Message----- > From: Dick Applebaum [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 11, 2002 5:32 PM > To: CF-Talk > Subject: Re: is there a trim function to get rid of a space between > names > > > I think you really need to ask for first name and last name > separately, > or just accept the full name the way they enter it. > > You run into problems in certain cultures where the surname is used > first. > > Also, I remember one lady named [sp]: > > sue man joe > > How do handle that? > > HTH > > Dick > > > On Wednesday, September 11, 2002, at 02:17 PM, S. Isaac Dealey wrote: > > > 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 > >>> > >>> > >>> > >>> > >> > > > ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm 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

