Public Function LastIndexOf(searchIn As String, searchFor As String) As String LastIndexOf = InStrRev(searchIn, searchFor) End Function Public Function Suffix(searchIn As String, searchFor As String) As String Suffix = Right$(searchIn, Len(searchIn) - LastIndexOf(searchIn, searchFor)) End Function Public Function FileExtension(fileSpec As String) Dim afterPeriod As String Dim afterSlash As String afterPeriod = Suffix(fileSpec, ".") afterSlash = Suffix(fileSpec, "\") If Len(afterPeriod) > Len(afterSlash) Then FileExtension = "" Else FileExtension = afterPeriod End If End Function
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.