Java Class Simple Name Get simpleName(final String fqn)

Here you can find the source of simpleName(final String fqn)

Description

simple Name

License

Apache License

Declaration

public static String simpleName(final String fqn) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String simpleName(final String fqn) {
        int dotIndex = fqn.lastIndexOf(".");
        if (dotIndex == -1) {
            return fqn;
        }//www .j  av  a 2 s.  c o  m
        if (dotIndex == fqn.length() - 1) {
            throw new IllegalArgumentException("Bad class name (trailing dot) [" + fqn + "]");
        }
        return fqn.substring(dotIndex + 1);
    }
}

Related

  1. simpleClassNameFrom(String fqClassName)
  2. simpleClassNameOf(Class c)
  3. simpleName(Class clazz)
  4. simpleName(Class c)
  5. simpleName(final Class className)
  6. simpleName(final String fullyQualifiedClassName)
  7. simpleName(final String name)
  8. simpleName(Object obj)
  9. simpleName(String className)