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 getFileName(String url) {
        int index = url.lastIndexOf("/");
        if (index == -1 || index == url.length() - 1) {
            return url;
        } else {
            return url.substring(index + 1);
        }
    }
}