heymishy
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 7/4/2011
-
Status: offline
|
String manipulation - remove before '\' character
Monday, July 04, 2011 8:07 PM
( permalink)
Hi everyone, Im very much a casual dev, more of a technical analyst, but i have to knock up a VBScript to drop of the domain from a username. basically what I have is a username returned as 'domain\username' in the username and need to get just the value after the '\' What I currently have works, but appears to render quite slowly, and may not be the best method. So if anyone has a more efficient / smoother way of achieving the same result - I'd be all ears! ** Trim the domain from the username trimloc = InStr(username, "\") int = cint(trimloc) trimloc = int + 1 username = mid(username, trimLoc) Really appreciate the input from a part-time dev! Regards, Hamish.
<message edited by heymishy on Monday, July 04, 2011 8:22 PM>
|
|
|
|
mcnd
-
Total Posts
:
50
- Scores: 2
-
Reward points
:
0
- Joined: 4/27/2008
-
Status: offline
|
Re:String manipulation - remove before '\' character
Monday, July 04, 2011 11:56 PM
( permalink)
username = Split( username, "\")(1)
|
|
|
|
heymishy
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 7/4/2011
-
Status: offline
|
Re:String manipulation - remove before '\' character
Tuesday, July 05, 2011 10:48 AM
( permalink)
Wow - that really is a more efficient solution.. thanks! Script still running a bit slow, so must be different part of the code.. back to debugging! thanks mcnd!
|
|
|
|