Here you can find the source of getDirAndFullName(File f)
Parameter | Description |
---|---|
f | a parameter |
public static String[] getDirAndFullName(File f)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**//from w w w. j a va 2 s .c o m * * @param f * @return {dir, fullName} */ public static String[] getDirAndFullName(File f) { String path = f.getPath(); int index = path.lastIndexOf('/'); if (index == -1) { index = path.lastIndexOf('\\'); } return new String[] { path.substring(0, index + 1), path.substring(index + 1) }; } }