Android Path Split sepPath(String filePath)

Here you can find the source of sepPath(String filePath)

Description

sep Path

Declaration

public static String[] sepPath(String filePath) 

Method Source Code

//package com.java2s;

public class Main {

    public static String[] sepPath(String filePath) {
        if (filePath == null || !filePath.contains("/")) {
            return null;
        }//from   ww w.j  a v  a  2s .co  m
        if (filePath.endsWith("/")) {
            filePath = filePath.substring(0, filePath.length() - 1);
        }
        int index = filePath.lastIndexOf("/") + 1;
        String[] arr = new String[2];
        arr[0] = filePath.substring(0, index);
        arr[1] = filePath.substring(index);
        return arr;
    }
}