' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Function extrem(fnm)
   For i = Len(fnm) To 1 Step -1
      If Mid(fnm, i, 1) = "." Then
          extrem = Left(fnm, i-1)
          Exit For
      End If
   Next
End Function

WScript.Echo extrem("filnavn.jpg")
WScript.Echo extrem("filnavn.jpeg")
