VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Function to find the last part of string. If you know PATH name you can cut off first part and re

by Eugene Levitin (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Fri 17th September 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Function to find the last part of string. If you know PATH name you can "cut off" first part and return just FILE name. fileName =

Rate Function to find the last part of string. If you know PATH name you can cut off first part and re




Dim chrMostRight_tmp As String
Dim nChr, j, Count, chrPlace As Integer

    nChr = Len(strInput)
    
        For j = nChr To 1 Step -1
            chrMostRight_tmp = Left(strInput, j)
            If Right(chrMostRight_tmp, 1) = chrMostRight Then Exit For
            Count = Count + 1
        Next
    
    chrPlace = nChr - (Count - 1)
    strRightPart = Mid$(strInput, chrPlace)

End Function


Download this snippet    Add to My Saved Code

Function to find the last part of string. If you know PATH name you can cut off first part and re Comments

No comments have been posted about Function to find the last part of string. If you know PATH name you can cut off first part and re. Why not be the first to post a comment about Function to find the last part of string. If you know PATH name you can cut off first part and re.

Post your comment

Subject:
Message:
0/1000 characters