If you are sure you will only have one space, you can do:
<CFSET FirstName = ListFirst(Name," ")>
<CFSET LastName = ListRest(Name," ")>
However, if the str is "Raymond Kenneth Camden", then you will get
Kenneth Camden as the last name.
If you want to ensure that the person only enters X Y, just do:
<CFIF NOT ListLen(Name," ") IS 2>
you stink
</CFIF>
=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia
Email : [EMAIL PROTECTED]
Yahoo IM : morpheus
"My ally is the Force, and a powerful ally it is." - Yoda
> -----Original Message-----
> From: Joshua Tipton [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 02, 2001 9:08 AM
> To: CF-Talk
> Subject: Split Variable
>
>
> I have a variable that is passed such as Lonwood Leesburg.
> Sometimes Central Orlando. I need to know how to split it at
> the space then insert one half into one column of a db and
> the other half to another column of the db.
>
> Joshua Tipton
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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