Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.File;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
    public static String getFileName(String path) {
        Pattern pattern = Pattern.compile("[^\\" + File.separator + "]+.xml");
        Matcher matcher = pattern.matcher(path);
        if (matcher.find())
            return matcher.group().substring(0, matcher.group().length() - 4);
        return "";
    }
}