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 {
    private static final String CORE_PREFIX = "Core_";
    private static final String FAE_PREFIX = "FAE_";

    /**
     * Gets the characters name from the filename by stripping the prefix.
     * @return The characters name if prefixed correctly, null otherwise.
     */
    public static String getCharacterNameFromFilename(String filename) {
        if (filename.startsWith(CORE_PREFIX)) {
            return filename.replace(CORE_PREFIX, "");
        } else if (filename.startsWith(FAE_PREFIX)) {
            return filename.replace(FAE_PREFIX, "");
        }
        return null;
    }
}