public String getExtension ( String fileName ) { if ( fileName . lastIndexOf ( ' ' ) > - 1 ) { return ( fileName . substring ( fileName . lastIndexOf ( ' ' ) + 1 , fileName . length ( ) ) ) . toLowerCase ( ) ; } return null ; }
returns the file extension by filename separated by last dot