VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Returns File name or Drive name from given path in one line of code.

by Opal Raj Ghimire (7 Submissions)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Thu 5th July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Returns File name or Drive name from given path in one line of code.

Rate Returns File name or Drive name from given path in one line of code.





Dim sParts() As String
sParts = Split("C:\MyWorld\MyStyle\WhoCares\Junk.txt", "\")


'sParts(UBound(sParts)) contains File name 'Junk.txt'
'to check
MsgBox sParts(UBound(sParts))



'Drive name
MsgBox sParts(LBound(sParts))

Download this snippet    Add to My Saved Code

Returns File name or Drive name from given path in one line of code. Comments

No comments have been posted about Returns File name or Drive name from given path in one line of code.. Why not be the first to post a comment about Returns File name or Drive name from given path in one line of code..

Post your comment

Subject:
Message:
0/1000 characters