Java File Extension Name Get extractExtensions(String fileName)

Here you can find the source of extractExtensions(String fileName)

Description

extract Extensions

License

LGPL

Declaration

public static String extractExtensions(String fileName) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String extractExtensions(String fileName) {
        int pos = fileName.lastIndexOf(".");

        if (pos == -1)
            return "";

        return fileName.substring(fileName.lastIndexOf("."));
    }//from w ww. j  a  v a 2 s  . c o  m
}

Related

  1. extractExtension(String fileName)
  2. extractExtension(String name)
  3. extractExtension(String s)
  4. extractExtension(String strFilename)
  5. extractExtension(String url)
  6. fileExt(String name)
  7. fileExt(String url)
  8. fileExtension(CharSequence path)
  9. fileExtension(String filename)