Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Parse variable
Logged in as: Guest
arrSession:exec spGetSession 2,2,3209
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> Parse variable
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
Parse variable -
6/3/2005 1:13:19 AM
JKW2068
Posts: 71
Score: 0
Joined: 4/14/2005
From:
Status:
offline
My string Variable will Contain, WindowsXP,5,2,1
I just want "WindowsXP" and not ,5,2,1. Up 'till now I've been using
tempvalue = Replace(tempvalue, "5","") tempvalue = Replace(tempvalue, "2","") tempvalue = Replace(tempvalue, "1","") tempvalue = Replace(tempvalue, ",","")
to Remove the unwanted chars. Any ideas on how I can reduce code to get only WindowsXP? Thanks
Post #: 1
Re: Parse variable -
6/3/2005 1:25:56 AM
Zifter
Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status:
offline
Something like this:
strMyString = "WindowsXP,5,2,1" WScript.Echo Left(strMyString,InStr(strMyString,",")-1)
There are alternative solutions as well, like using Mid() or Split() or ...
Check the available String manipulation functions.
http://www.w3schools.com/vbscript/vbscript_ref_functions.asp#string
(in reply to
JKW2068
)
Post #: 2
Re: Parse variable -
6/3/2005 3:10:17 AM
JKW2068
Posts: 71
Score: 0
Joined: 4/14/2005
From:
Status:
offline
Awsome. Thanks
(in reply to
JKW2068
)
Post #: 3
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> Parse variable
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI