Código: Seleccionar todo
'---------------------------------------
'Coded by The Swash at 08/01/2010, thx DARK_J4V13R for generate personal idea
'[email protected]
'www.Indetectables.net
'---------------------------------------
Option Explicit
Public Function Getextension(spath As String) As String
Dim extension As String
Dim x As Integer
If Len(spath) = 0 Then Exit Function
If InStrRev(spath, ".") < InStrRev(spath, "\") Then Exit Function
x = InStrRev(spath, ".")
extension = Right$(spath, Len(spath) - x + 1)
If extension = vbNullString Then Exit Function
Getextension = extension
End Function
x = Getextension("C:\Indetectables.txt")
x = ".txt"
Full tested!