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 {
    public static int getDepth(String value) {
        int len = value.length();
        int levels = 0;
        char[] chars = new char[len];
        value.getChars(0, len, chars, 0);
        for (int i = 0; i < len; i++) {
            if (chars[i] == '/' && (i + 1 < len) && chars[i + 1] != '/') {
                levels++;
            }
        }
        return levels;
    }
}