|
-
Dec 2nd, 2005, 01:32 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Extracting part of a string
Hi all,
How do you extract part of a string? I.e.
[code]
Dim LongString as string
Dim ShortString as String
LongString = "iounfdhvg9oi35ih7ns98ohf9h0p8hef"
<Code to take the long string, and select the first 5 characters of it>
ShortString = <Newly snipped string>
MsgBox ShortString
(In message box)
iounf
Any ideas?
-
Dec 2nd, 2005, 01:38 AM
#2
Fanatic Member
Re: Extracting part of a string
The first 5 characters? Then use this.
VB Code:
Dim LongString as string
Dim ShortString as String
LongString = "iounfdhvg9oi35ih7ns98ohf9h0p8hef"
ShortString = Mid(LongString, 1, 5)
MsgBox ShortString
-
Dec 2nd, 2005, 01:40 AM
#3
Thread Starter
Addicted Member
Re: Extracting part of a string
Ahh! Great, thank you
-
Dec 2nd, 2005, 01:42 AM
#4
Fanatic Member
Re: [RESOLVED] Extracting part of a string
No problem, and so you know how to use the Mid function later on:
VB Code:
string = Mid([B]string to be used[/B], [B]starting length in the string[/B], [B]length to end at[/B])
-
Dec 2nd, 2005, 02:00 AM
#5
Thread Starter
Addicted Member
Re: [RESOLVED] Extracting part of a string
Oh? Great! I'll add it to my commands referances file. Thanks again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|