Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get filetype / file extension
#3
Member function str.GetFileExt

Code:
Copy      Help
function [$pathname]

;Gets filename extension.
;pathname - file name with or without path. Default: itself.


;EXAMPLE
;str s
;s.GetFileExt("c:\aaa\fff.eee")
;out s



if(!pathname) pathname=this

int i=findcr(pathname '\')+1
int j=findcr(pathname '.')+1
if(j>i) this.get(pathname j); this.trim("''")
else this=""


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)