Is there a function to get the directory part of a file path?
so from
String a=\"/root/sdcard/Pictures/img0001.jpg\";
A better way, use getParent() from File Class..
String a="/root/sdcard/Pictures/img0001.jpg"; // A valid file path
File file = new File(a);
String getDirectoryPath = file.getParent(); // Only return path if physical file exist else return null
http://developer.android.com/reference/java/io/File.html#getParent%28%29