Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String removeExtension(final String path) {
        final int dot = path.lastIndexOf(".");
        if (-1 == dot || 0 == dot || dot <= path.lastIndexOf("/") + 1) {
            return path;
        } else {
            return path.substring(0, dot);
        }
    }
}