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 getProjectRelativeRelativePath(String path, String buildDir) {
        path = path.replace('\\', '/');
        buildDir = buildDir.replace('\\', '/');
        int indexOfBuildDir = path.indexOf(buildDir);
        if (indexOfBuildDir == 0) {
            path = path.substring(buildDir.length());
        }
        if (path.startsWith("/")) {
            return path.substring(1);
        }
        return path;
    }
}