Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**
     * Cleanup title. Remove from title file extension and (...), [...]
     */
    public static String cleanupTitle(final String in) {
        String out = in;
        try {
            out = in.substring(0, in.lastIndexOf('.'));
            out = out.replaceAll("\\(.*?\\)|\\[.*?\\]", "").replaceAll("_", " ").replaceAll(".fb2$", "").trim();
        } catch (final IndexOutOfBoundsException e) {
        }
        return out;
    }
}