Saturday, March 31, 2012

Trimming Spaces

I'm having a problem with the ff. Front Office code. My desired output is to get the first letter of the First Name and all of the Last Name to the mailto. However, I always get spaces after the lastname even if I trimmed it down already.

Ex.
Name = Robert Garcia
Desired Output = RGarcia@dotnet.itags.org.emailtest.com
Actual Output = RGarcia @dotnet.itags.org.emailtest.com

*** CODE ***
href="mailto:<%=left(FP_FieldLink(fp_rs,"Firstname"),1) & TRIM(FP_FieldLink(fp_rs,"Lastname"))%>@dotnet.itags.org.emailtest.com">
*** CODE ***

Any inputs would be appreciated.What is FP_FieldLink?
Maybe its a non visible character which you need to get rid of? Try to get the ascii value of the white space and use this ascii value in the replace method. Do a response.write with:

asc(left(yourvar, spaceposition))

0 comments:

Post a Comment