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
Printable View
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
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 :)
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
or you can do this
Code:Dim I
Dim H
H + Text1.text
I = Mid(H,1,1)
Text2.text = I