1

I am using coldfusion 9 to add data into a MySQL database from a form.

I would like to create a username from the email address inputed into the form.

for example,

<cfset store_user_email = EMAILADDRESS>
<cfset store_username = trim EMAILADDRESS before the @>

I'm not sure how to trim down the email address?

Any help would be much appreciated.

elixireu
  • 255
  • 3
  • 15
  • 2
    You have 5 questions and have not accepted a single answer. I suggest you start marking some of them or the free help will dry up. FYI- I haven't answered any of them that I know of, so I don't have a dog in the hunt, I'm just letting you know. – Nate Jul 21 '11 at 21:45

1 Answers1

8
<cfset store_username = trim(listFirst(EMAILADDRESS,"@"))>
Henry
  • 32,689
  • 19
  • 120
  • 221