Results 1 to 3 of 3

Thread: string manipulation **RESOLVED**

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    South West UK
    Posts
    245

    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.
    A lowly programmer.

    http://www.sentinalgroup.com

  2. #2
    Lively Member
    Join Date
    Jun 2004
    Location
    Dubai, UAE
    Posts
    64
    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2002
    Location
    South West UK
    Posts
    245
    dude, many thanks, will try it out now. Thank God for VBFourms!
    A lowly programmer.

    http://www.sentinalgroup.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width