Link to home
Start Free TrialLog in
Avatar of johnnyjonathan
johnnyjonathan

asked on

Modify text using vbscript

Hello,
I have a dilemma,

In VBS, I have a variable that reads a text input:

strObj = "Text/Text2/Text3"

I need to edit strObj so it will say only "Text/Text2" (basically discard everything after the 2nd "/" including)

Any advise?
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of johnnyjonathan
johnnyjonathan

ASKER

Thanks all! worked like a charm
Not griping, you are certainly free to select any working solution as you see fit.  Just want to understand if I missed anything, what made http:#a39163344 such an inferior solution for you, seems pretty compact and effective?  Or was it just because it wasn't first on the scene?

~bp
I agree. I did the same thing as @billprew - we posted just about the same time.  The only difference is I made a function so you can call the function anywhere in the code multiple times with one line.

There are always many ways to the same visual outcome though.