Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trimmin characters 1

Status
Not open for further replies.

teroy

Programmer
Oct 17, 2000
67
AU
Hi I'm quite new to Cold Fusion and was wondering
If i had a variable that contained
someone@someone.com

how do i get rid of everything after the "someone" part

ie ..get rid of the @ sign as well as the domain..where the domain is always different

Thanks in Advance :)
 
I think this will do what you want.

<cfset email=&quot;someone@someone.com&quot;>
<cfset user = listgetat(email,1,&quot;@&quot;)>

This will strip off everything before the first @ even if it contains more than one.

GJ
 
Thanks for that!! It worked perfectly

Cheers
 
Nice one GunJack :)! The following code does the same, and uses the very underrated function SpanExcluding :) :

<cfset email=&quot;someone@someone.com&quot;>
<cfset user=SpanExcluding(email, &quot;@&quot;)>

Good luck teroy!



<webguru>iqof188</webguru>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top