|
-
Jan 14th, 2000, 10:54 PM
#1
Thread Starter
Junior Member
In my program I have strings like " 49 49 13 49 23 49" without the quotes and I use Trim to take away spaces then Left to take the first two numbers but how can I "cut" the numbers out of the string?
Andy
-
Jan 14th, 2000, 11:57 PM
#2
PowerPoster
try using
MyString = Right(MyString, Len(MyString) - 2)
This works my taking the original MyString minus 2 characters and placing it back in MyString. There is probably a "better" way of doing it, but it works fine for me.
Regards,
------------------
- Chris
[email protected]
If it ain't broke - don't fix it 
-
Jan 15th, 2000, 12:27 PM
#3
Guru
you can extract the numbers into an array using the VB6 split function:
Code:
Dim strTemp As String
Dim strArray() As String
Dim I As Integer
strTemp = " 49 49 13 49 23 49"
strArray() = Split(strTemp, " ")
For I = LBound(strArray) To UBound(strArray)
Debug.Print strArray(I)
Next I
-
Jan 15th, 2000, 12:32 PM
#4
Addicted Member
or you can do this
Code:
Dim I
Dim H
H + Text1.text
I = Mid(H,1,1)
Text2.text = I
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
|