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 {

    private static String getFileNameFromPath(String filePath) {
        int begin = filePath.lastIndexOf(File.separator);
        int end = filePath.lastIndexOf(".");
        if (end < 1) {
            return null;
        }
        String fileName = filePath.substring(begin + 1, end);
        return fileName;
    }
}