|
-
Jun 28th, 2004, 02:04 AM
#1
Thread Starter
Addicted Member
string manipulation **RESOLVED**
ok,i think this is really simple, i have a string e.g.
.xls Excel File
what i would like to do is extract just the xls part, how can i do this so i read from the second cha=racter position until i find a space and retrieve the info in between?
Last edited by HELPmyVB; Jun 28th, 2004 at 02:43 AM.
-
Jun 28th, 2004, 02:18 AM
#2
Lively Member
Hi
You can use Mid() and Instr() in tandem. Like,
Mid(fileString,2,Instr(1,fileString," ",vbTextCompare)-1 would do the job.
where
Mid() is a function retrieves a part of the string
Instr() gets the position of the specfic character/string
fileString is a variable holding your file name & details.
2 starts from the second character
-1 till the previous character (just before the space)
Gs
-
Jun 28th, 2004, 02:42 AM
#3
Thread Starter
Addicted Member
dude, many thanks, will try it out now. Thank God for VBFourms!
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
|