VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Two lines of code to extract the file name from a full file path.

by Murali Bala (7 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 12th May 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Two lines of code to extract the file name from a full file path.

Rate Two lines of code to extract the file name from a full file path.



    Dim sFpath() As String
    
    sFpath = Split(sPath, "\")
    GetFileName = sFpath(UBound(sFpath()))
   
End Function

Private Sub Command1_Click()
Dim s As String
    s = GetFileName("c:\ABC\Test.mdb")
    MsgBox s
End Sub

Download this snippet    Add to My Saved Code

Two lines of code to extract the file name from a full file path. Comments

No comments have been posted about Two lines of code to extract the file name from a full file path.. Why not be the first to post a comment about Two lines of code to extract the file name from a full file path..

Post your comment

Subject:
Message:
0/1000 characters