|
-
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 firt two numbers but how can I "cut" the numbers out of the string?
Andy
-
Jan 15th, 2000, 02:37 AM
#2
geez, thanks. I 'assumed' AndyC had a brain, my mistake.
-
Jan 15th, 2000, 05:58 AM
#3
Hyperactive Member
Could somebody please tell me how to use the Trim$(string)? I used this code to remove all the spaces but it did not work:
Trim(strString)
Whats wrong with that?
Thanks
-
Jan 15th, 2000, 06:12 AM
#4
it trims the all of the spaces before and after a string but not within the string. If you want to replace all of the spaces in a string try:
somevariable = replace("your string",Chr(32),"")
that removes all of the spaces in your string
[This message has been edited by pvb (edited 01-15-2000).]
-
Jan 15th, 2000, 12:37 PM
#5
use mid(string, start, length)
-
Jan 15th, 2000, 12:48 PM
#6
seeing as pvb didn't bother explaining it, this is how you use the MID function...
if you want the third number (13) do this:
Code:
MyNumber = mid(YourString, 7, 2)
"MyNumber" now contains the string "13", 7 in the brackets is the starting point of the desired string and "13" is 2 characters long, hence the 2 in the brackets.
if you want to convert this "13" into a number instead of a string, then use...
val(mid(YourString, 7, 2))
instead.
------------------
Wossname,
Email me: [email protected] 
[This message has been edited by wossname (edited 01-15-2000).]
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
|