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 getClassSimpleName(final Class<?> clz) {
        final String name = clz.getName();
        final int endCutOff = name.length();
        int beginCutOff = name.lastIndexOf(".") + 1;

        if (beginCutOff == -1)
            beginCutOff = 1;

        return name.substring(beginCutOff, endCutOff);
    }

    public static int length(final String s, final String separator) {
        final String[] list = s.split(separator);
        return list.length;
    }
}