How do I remove characters from the right of a populated variable, removing
@bla.com from a UPN for example? Assume variableA = first.last@bla.com

I've tried using things like - variableB = Right(variableA, 8), I know it
returns the last 8 as the variable I'm using - variableB =
StripRightNCharacters(variableA, 8), this one returned nothing so I may be
using it wrong.

I know the characters I want to remove, they are always on the right and
always the same number, and always the same characters, like @bla.com

Everything seems to be geared towards counting from the left and trimming,
but the number of characters on the left change in my example...

Is there a simple function I can call that I'm not seeing?

Thank you,
--
Sean M. Loftus
Enterprise Architect
Loftus Consulting, Inc.
www.LoftusConsulting.com
sean(removeme)@loftus.org

Re: How do I remove 8 Characters from the Right of a variable? by Bob

Bob
Tue Nov 29 10:32:21 CST 2005

Sean M. Loftus wrote:
> How do I remove characters from the right of a populated variable,
> removing @bla.com from a UPN for example? Assume variableA =
> first.last@bla.com
>
variableA = Left(variableA,len(variableA)-8)

Better yet:
atpos=instr(variableA,"@")
if atpos>0 then
variableA = Left(variableA, atpos-1)
end if

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Re: How do I remove 8 Characters from the Right of a variable? by Sean

Sean
Tue Nov 29 11:37:52 CST 2005

Thank you that worked perfect!

S-


"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OLTK6JQ9FHA.472@TK2MSFTNGP15.phx.gbl...
> Sean M. Loftus wrote:
>> How do I remove characters from the right of a populated variable,
>> removing @bla.com from a UPN for example? Assume variableA =
>> first.last@bla.com
>>
> variableA = Left(variableA,len(variableA)-8)
>
> Better yet:
> atpos=instr(variableA,"@")
> if atpos>0 then
> variableA = Left(variableA, atpos-1)
> end if
>
> Bob Barrows
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>



Re: How do I remove 8 Characters from the Right of a variable? by \

\
Tue Nov 29 11:49:36 CST 2005

Or:

VariableA=split(VariableA,"@")(0)
--
Crash