remove File Extension Name - Java java.io

Java examples for java.io:File Extension Name

Description

remove File Extension Name

Demo Code


//package com.java2s;

public class Main {

    public static String removeExtension(String name) {
        String ret = "";
        for (int i = 0; i < name.lastIndexOf('.'); i++) {
            ret += name.charAt(i);/*from ww w. j  a v  a  2 s . c  om*/
        }
        return ret;
    }
}

Related Tutorials