Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.File;

public class Main {

    public static String getPathFromFilepath(String path) {
        int index = path.lastIndexOf(File.separator);
        String p = File.separator;
        if (index != -1) {
            p = path.substring(0, index);
        }
        return p;
    }
}