|
 |
asp_databases thread: Using Ltrim
Message #1 by "simon newton" <simonn@h...> on Sun, 18 Mar 2001 21:29:18
|
|
Good morning all,
I have a case where i have to remove the domain name from users names in
the "remote user" session variable when i return it to a database.
cureently it returns "Domainname/Username" i would really like to remove
the "domainname/" section before its written to the database, and have
little idea how to.. should i use the Ltrim func.. or can it just remove
spaces???
cheers
Simon
Message #2 by "Ken Schaefer" <ken@a...> on Mon, 19 Mar 2001 21:34:04 +1100
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Good morning all,
:
: I have a case where i have to remove the domain name from users names in
: the "remote user" session variable when i return it to a database.
: cureently it returns "Domainname/Username" i would really like to remove
: the "domainname/" section before its written to the database, and have
: little idea how to.. should i use the Ltrim func.. or can it just remove
: spaces???
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you are doing this in ASP, then Ltrim() is not available - you only have
Trim(), but that's not what you're looking for. Go here:
http://msdn.microsoft.com/scripting/vbscript/download/vbsdoc.exe
and look up Right() and InStr()
If you are doing this in SQL Server, then goto Start | Program Files | SQL
Server | Books Online
and look up LTrim() to find out what it does. What you really want is
Right() and CharIndex()
Cheers
Ken
Message #3 by "Dallas Martin" <dmartin@z...> on Sun, 18 Mar 2001 21:25:31 -0500
|
|
Try using the split() function.
For example, if the "remote user" variable is "mydomain/jdoe" then
arrParts = split("mydomain/jdoe","/") will return
arrParts(0) = "MyDomain"
arrParts(1) = "jdoe"
Dallas Martin
----- Original Message -----
From: "simon newton" <simonn@h...>
To: "ASP Databases" <asp_databases@p...>
Sent: Sunday, March 18, 2001 9:29 PM
Subject: [asp_databases] Using Ltrim
> Good morning all,
>
> I have a case where i have to remove the domain name from users names in
> the "remote user" session variable when i return it to a database.
> cureently it returns "Domainname/Username" i would really like to remove
> the "domainname/" section before its written to the database, and have
> little idea how to.. should i use the Ltrim func.. or can it just remove
> spaces???
>
> cheers
>
> Simon
|
|
 |