dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Get Filename from Path

  1. #1
    Join Date
    Apr 2002
    Location
    Belgium
    Posts
    125

    Get Filename from Path

    Hello,

    I wan tot get the filename from a path, like:
    C:\Program Files\Visual Basic\Visual.Exe
    that my output should be:
    Visual.Exe
    I used instr to get the place of the "\" but then, it says where the first \ is, how can i get the place of the last ?

    Thanks

    //EDIT maybe i can get the position of the first, start there with instr, and get the next, next, untill the final, gonna test it
    Bert Willekens,

  2. #2
    Join Date
    Apr 2002
    Location
    Egypt
    Posts
    2,210
    use InStrRev to start seraching from the end

  3. #3
    Join Date
    Apr 2002
    Location
    Belgium
    Posts
    125
    aaaha, allot better
    Bert Willekens,

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)