VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Strips filename from complete path

by W.Veldhuis (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 18th January 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Strips filename from complete path

Rate Strips filename from complete path



'**************************************************************************
'* Name         : StripFileFromPath
'* Description  : strips the file name from string
'*                containing drive letter and path's
'* Input        : Path, like "C:\WINNT\SYSTEM\TEXT.LOG"
'* Output       : "TEXT.LOG"
'*-------------------------------------------------------------------------
'* Rev,Date,Who,What
'* A,18-01-2003,W.Veldhuis,Initial Version
'**************************************************************************
For i = Len(path) To 0 Step -1
 If Mid(path, i, 1) <> "\" Then
  StripFileFromPath = Mid(path, i, 1) + StripFileFromPath
 Else
  Exit For
 End If
Next i
End Function


Download this snippet    Add to My Saved Code

Strips filename from complete path Comments

No comments have been posted about Strips filename from complete path. Why not be the first to post a comment about Strips filename from complete path.

Post your comment

Subject:
Message:
0/1000 characters