Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    private static String removeSlashInStartAndAddAtTheEndOfBaseDir(String baseDir) {
        baseDir = baseDir.endsWith("/") ? baseDir : baseDir + "/";

        while (baseDir.startsWith("/") || baseDir.startsWith("./")) {
            baseDir = baseDir.startsWith("/") ? baseDir.substring(1) : baseDir;
            baseDir = baseDir.startsWith("./") ? baseDir.substring(2) : baseDir;
        }

        return baseDir;
    }
}