[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? :)
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
Re: Extracting part of a string
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])
Re: [RESOLVED] Extracting part of a string
Oh? Great! I'll add it to my commands referances file. Thanks again!