Android Path to File Name Convert getFileNameIndexFromPath(String filePathName)

Here you can find the source of getFileNameIndexFromPath(String filePathName)

Description

get File Name Index From Path

License

Apache License

Declaration

public static int getFileNameIndexFromPath(String filePathName) 

Method Source Code

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

public class Main {

    public static int getFileNameIndexFromPath(String filePathName) {
        if (filePathName.toLowerCase().lastIndexOf("/") > -1) {
            return filePathName.toLowerCase().lastIndexOf("/");
        } else {/*from  w  w  w  . j a  va  2s. c om*/
            return filePathName.toLowerCase().lastIndexOf("\\");
        }
    }
}

Related

  1. getFilename(String path)
  2. getShortFileName(String fullFileName)
  3. extractFolderOrFilename(String path)
  4. getFileName(String path)