how do I trim an email input address so only the data before the @ is inputted into the database?
问题 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. 回答1: <cfset store_username = trim(listFirst(EMAILADDRESS,"@"))> 来源: https://stackoverflow.com/questions/6775360/how-do-i-trim-an-email-input-address-so