Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Returns file name without path information.
     * 
     * @param filename
     * @return
     */
    public static String shortFilename(String filename) {
        int pos = filename.lastIndexOf(java.io.File.separatorChar);
        if (pos != -1)
            return filename.substring(pos + 1);
        else
            return filename;
    }
}