Java Class Simple Name Get simpleName(String qualifiedClassName)

Here you can find the source of simpleName(String qualifiedClassName)

Description

simple Name

License

Apache License

Declaration

public static String simpleName(String qualifiedClassName) 

Method Source Code

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

public class Main {
    public static String simpleName(String qualifiedClassName) {
        String packageName = packageName(qualifiedClassName);
        return packageName.isEmpty() ? qualifiedClassName : qualifiedClassName.substring(packageName.length() + 1);
    }/*from   ww w. j ava  2  s  .  c om*/

    public static String packageName(String qualifiedClassName) {
        int pos = qualifiedClassName.lastIndexOf('.');
        return (pos >= 0) ? qualifiedClassName.substring(0, pos) : "";
    }
}

Related

  1. simpleName(final String fullyQualifiedClassName)
  2. simpleName(final String name)
  3. simpleName(Object obj)
  4. simpleName(String className)
  5. simpleName(String componentName)
  6. simpleName(String qualifiedName)
  7. simpleName(String type)
  8. simpleNameFromQualifiedName(String qualifiedName)
  9. simpleNameOf(String s)